Class KeyRingReader


  • public class KeyRingReader
    extends Object
    • Constructor Detail

      • KeyRingReader

        public KeyRingReader()
    • Method Detail

      • publicKeyRing

        public org.bouncycastle.openpgp.PGPPublicKeyRing publicKeyRing​(@Nonnull
                                                                       byte[] bytes)
                                                                throws IOException
        Throws:
        IOException
      • publicKeyRing

        public org.bouncycastle.openpgp.PGPPublicKeyRing publicKeyRing​(@Nonnull
                                                                       String asciiArmored)
                                                                throws IOException
        Throws:
        IOException
      • publicKeyRingCollection

        public org.bouncycastle.openpgp.PGPPublicKeyRingCollection publicKeyRingCollection​(@Nonnull
                                                                                           InputStream inputStream)
                                                                                    throws IOException,
                                                                                           org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • publicKeyRingCollection

        public org.bouncycastle.openpgp.PGPPublicKeyRingCollection publicKeyRingCollection​(@Nonnull
                                                                                           byte[] bytes)
                                                                                    throws IOException,
                                                                                           org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • publicKeyRingCollection

        public org.bouncycastle.openpgp.PGPPublicKeyRingCollection publicKeyRingCollection​(@Nonnull
                                                                                           String asciiArmored)
                                                                                    throws IOException,
                                                                                           org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • secretKeyRing

        public org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing​(@Nonnull
                                                                       byte[] bytes)
                                                                throws IOException
        Throws:
        IOException
      • secretKeyRing

        public org.bouncycastle.openpgp.PGPSecretKeyRing secretKeyRing​(@Nonnull
                                                                       String asciiArmored)
                                                                throws IOException
        Throws:
        IOException
      • secretKeyRingCollection

        public org.bouncycastle.openpgp.PGPSecretKeyRingCollection secretKeyRingCollection​(@Nonnull
                                                                                           InputStream inputStream)
                                                                                    throws IOException,
                                                                                           org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • secretKeyRingCollection

        public org.bouncycastle.openpgp.PGPSecretKeyRingCollection secretKeyRingCollection​(@Nonnull
                                                                                           byte[] bytes)
                                                                                    throws IOException,
                                                                                           org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • secretKeyRingCollection

        public org.bouncycastle.openpgp.PGPSecretKeyRingCollection secretKeyRingCollection​(@Nonnull
                                                                                           String asciiArmored)
                                                                                    throws IOException,
                                                                                           org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • keyRingCollection

        public PGPKeyRingCollection keyRingCollection​(@Nonnull
                                                      byte[] bytes,
                                                      boolean isSilent)
                                               throws IOException,
                                                      org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • readPublicKeyRing

        public static org.bouncycastle.openpgp.PGPPublicKeyRing readPublicKeyRing​(@Nonnull
                                                                                  InputStream inputStream)
                                                                           throws IOException
        Throws:
        IOException
      • readPublicKeyRing

        public static org.bouncycastle.openpgp.PGPPublicKeyRing readPublicKeyRing​(@Nonnull
                                                                                  InputStream inputStream,
                                                                                  int maxIterations)
                                                                           throws IOException
        Read a public key ring from the provided InputStream. If more than maxIterations PGP packets are encountered before a PGPPublicKeyRing is read, an IOException is thrown.
        Parameters:
        inputStream - input stream
        maxIterations - max iterations before abort
        Returns:
        public key ring
        Throws:
        IOException - in case of an IO error or exceeding of max iterations
      • readPublicKeyRingCollection

        public static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPublicKeyRingCollection​(@Nonnull
                                                                                                      InputStream inputStream)
                                                                                               throws IOException,
                                                                                                      org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • readPublicKeyRingCollection

        public static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPublicKeyRingCollection​(@Nonnull
                                                                                                      InputStream inputStream,
                                                                                                      int maxIterations)
                                                                                               throws IOException,
                                                                                                      org.bouncycastle.openpgp.PGPException
        Read a public key ring collection from the provided InputStream. If more than maxIterations PGP packets are encountered before the stream is exhausted, an IOException is thrown.
        Parameters:
        inputStream - input stream
        maxIterations - max iterations before abort
        Returns:
        public key ring collection
        Throws:
        IOException - in case of an IO error or exceeding of max iterations
        org.bouncycastle.openpgp.PGPException - in case of a broken key
      • readSecretKeyRing

        public static org.bouncycastle.openpgp.PGPSecretKeyRing readSecretKeyRing​(@Nonnull
                                                                                  InputStream inputStream)
                                                                           throws IOException
        Throws:
        IOException
      • readSecretKeyRing

        public static org.bouncycastle.openpgp.PGPSecretKeyRing readSecretKeyRing​(@Nonnull
                                                                                  InputStream inputStream,
                                                                                  int maxIterations)
                                                                           throws IOException
        Read a secret key ring from the provided InputStream. If more than maxIterations PGP packets are encountered before a PGPSecretKeyRing is read, an IOException is thrown.
        Parameters:
        inputStream - input stream
        maxIterations - max iterations before abort
        Returns:
        public key ring
        Throws:
        IOException - in case of an IO error or exceeding of max iterations
      • readSecretKeyRingCollection

        public static org.bouncycastle.openpgp.PGPSecretKeyRingCollection readSecretKeyRingCollection​(@Nonnull
                                                                                                      InputStream inputStream)
                                                                                               throws IOException,
                                                                                                      org.bouncycastle.openpgp.PGPException
        Throws:
        IOException
        org.bouncycastle.openpgp.PGPException
      • readSecretKeyRingCollection

        public static org.bouncycastle.openpgp.PGPSecretKeyRingCollection readSecretKeyRingCollection​(@Nonnull
                                                                                                      InputStream inputStream,
                                                                                                      int maxIterations)
                                                                                               throws IOException,
                                                                                                      org.bouncycastle.openpgp.PGPException
        Read a secret key ring collection from the provided InputStream. If more than maxIterations PGP packets are encountered before the stream is exhausted, an IOException is thrown.
        Parameters:
        inputStream - input stream
        maxIterations - max iterations before abort
        Returns:
        secret key ring collection
        Throws:
        IOException - in case of an IO error or exceeding of max iterations
        org.bouncycastle.openpgp.PGPException - in case of a broken secret key