Class OpenPgpMessageInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class OpenPgpMessageInputStream
    extends DecryptionStream
    • Field Detail

      • syntaxVerifier

        protected final PDA syntaxVerifier
      • nestedInputStream

        protected java.io.InputStream nestedInputStream
    • Constructor Detail

      • OpenPgpMessageInputStream

        protected OpenPgpMessageInputStream​(@Nonnull
                                            java.io.InputStream inputStream,
                                            @Nonnull
                                            ConsumerOptions options,
                                            @Nonnull
                                            MessageMetadata.Layer metadata,
                                            @Nonnull
                                            Policy policy)
                                     throws org.bouncycastle.openpgp.PGPException,
                                            java.io.IOException
        Throws:
        org.bouncycastle.openpgp.PGPException
        java.io.IOException
      • OpenPgpMessageInputStream

        protected OpenPgpMessageInputStream​(@Nonnull
                                            org.pgpainless.decryption_verification.OpenPgpMessageInputStream.Type type,
                                            @Nonnull
                                            java.io.InputStream inputStream,
                                            @Nonnull
                                            ConsumerOptions options,
                                            @Nonnull
                                            MessageMetadata.Layer metadata,
                                            @Nonnull
                                            Policy policy)
                                     throws org.bouncycastle.openpgp.PGPException,
                                            java.io.IOException
        Throws:
        org.bouncycastle.openpgp.PGPException
        java.io.IOException
    • Method Detail

      • create

        public static OpenPgpMessageInputStream create​(@Nonnull
                                                       java.io.InputStream inputStream,
                                                       @Nonnull
                                                       ConsumerOptions options)
                                                throws java.io.IOException,
                                                       org.bouncycastle.openpgp.PGPException
        Create an OpenPgpMessageInputStream suitable for decryption and verification of OpenPGP messages and signatures. This constructor will use the global PGPainless Policy.
        Parameters:
        inputStream - underlying input stream
        options - options for consuming the stream
        Returns:
        input stream that consumes OpenPGP messages
        Throws:
        java.io.IOException - in case of an IO error
        org.bouncycastle.openpgp.PGPException - in case of an OpenPGP error
      • create

        public static OpenPgpMessageInputStream create​(@Nonnull
                                                       java.io.InputStream inputStream,
                                                       @Nonnull
                                                       ConsumerOptions options,
                                                       @Nonnull
                                                       Policy policy)
                                                throws org.bouncycastle.openpgp.PGPException,
                                                       java.io.IOException
        Create an OpenPgpMessageInputStream suitable for decryption and verification of OpenPGP messages and signatures. This factory method takes a custom Policy instead of using the global policy object.
        Parameters:
        inputStream - underlying input stream containing the OpenPGP message
        options - options for consuming the message
        policy - policy for acceptable algorithms etc.
        Returns:
        input stream that consumes OpenPGP messages
        Throws:
        org.bouncycastle.openpgp.PGPException - in case of an OpenPGP error
        java.io.IOException - in case of an IO error
      • create

        protected static OpenPgpMessageInputStream create​(@Nonnull
                                                          java.io.InputStream inputStream,
                                                          @Nonnull
                                                          ConsumerOptions options,
                                                          @Nonnull
                                                          MessageMetadata.Layer metadata,
                                                          @Nonnull
                                                          Policy policy)
                                                   throws java.io.IOException,
                                                          org.bouncycastle.openpgp.PGPException
        Throws:
        java.io.IOException
        org.bouncycastle.openpgp.PGPException
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(@Nonnull
                        byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException