Class OpenPgpMessageInputStream
java.lang.Object
java.io.InputStream
org.pgpainless.decryption_verification.DecryptionStream
org.pgpainless.decryption_verification.OpenPgpMessageInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InputStreamprotected final ConsumerOptionsprotected TeeBCPGInputStreamprotected final PDA -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOpenPgpMessageInputStream(InputStream inputStream, ConsumerOptions options, MessageMetadata.Layer metadata, Policy policy) protectedOpenPgpMessageInputStream(org.pgpainless.decryption_verification.OpenPgpMessageInputStream.Type type, InputStream inputStream, ConsumerOptions options, MessageMetadata.Layer metadata, Policy policy) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static OpenPgpMessageInputStreamcreate(InputStream inputStream, ConsumerOptions options) Create anOpenPgpMessageInputStreamsuitable for decryption and verification of OpenPGP messages and signatures.protected static OpenPgpMessageInputStreamcreate(InputStream inputStream, ConsumerOptions options, MessageMetadata.Layer metadata, Policy policy) static OpenPgpMessageInputStreamcreate(InputStream inputStream, ConsumerOptions options, Policy policy) Create anOpenPgpMessageInputStreamsuitable for decryption and verification of OpenPGP messages and signatures.Returnmetadataabout the decrypted / verified message.intread()intread(byte[] b, int off, int len) Methods inherited from class org.pgpainless.decryption_verification.DecryptionStream
getResultMethods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
options
-
syntaxVerifier
-
packetInputStream
-
nestedInputStream
-
-
Constructor Details
-
OpenPgpMessageInputStream
protected OpenPgpMessageInputStream(@Nonnull InputStream inputStream, @Nonnull ConsumerOptions options, @Nonnull MessageMetadata.Layer metadata, @Nonnull Policy policy) throws org.bouncycastle.openpgp.PGPException, IOException - Throws:
org.bouncycastle.openpgp.PGPExceptionIOException
-
OpenPgpMessageInputStream
protected OpenPgpMessageInputStream(@Nonnull org.pgpainless.decryption_verification.OpenPgpMessageInputStream.Type type, @Nonnull InputStream inputStream, @Nonnull ConsumerOptions options, @Nonnull MessageMetadata.Layer metadata, @Nonnull Policy policy) throws org.bouncycastle.openpgp.PGPException, IOException - Throws:
org.bouncycastle.openpgp.PGPExceptionIOException
-
-
Method Details
-
create
public static OpenPgpMessageInputStream create(@Nonnull InputStream inputStream, @Nonnull ConsumerOptions options) throws IOException, org.bouncycastle.openpgp.PGPException Create anOpenPgpMessageInputStreamsuitable for decryption and verification of OpenPGP messages and signatures. This constructor will use the global PGPainlessPolicy.- Parameters:
inputStream- underlying input streamoptions- options for consuming the stream- Returns:
- input stream that consumes OpenPGP messages
- Throws:
IOException- in case of an IO errororg.bouncycastle.openpgp.PGPException- in case of an OpenPGP error
-
create
public static OpenPgpMessageInputStream create(@Nonnull InputStream inputStream, @Nonnull ConsumerOptions options, @Nonnull Policy policy) throws org.bouncycastle.openpgp.PGPException, IOException Create anOpenPgpMessageInputStreamsuitable for decryption and verification of OpenPGP messages and signatures. This factory method takes a customPolicyinstead of using the global policy object.- Parameters:
inputStream- underlying input stream containing the OpenPGP messageoptions- options for consuming the messagepolicy- policy for acceptable algorithms etc.- Returns:
- input stream that consumes OpenPGP messages
- Throws:
org.bouncycastle.openpgp.PGPException- in case of an OpenPGP errorIOException- in case of an IO error
-
create
protected static OpenPgpMessageInputStream create(@Nonnull InputStream inputStream, @Nonnull ConsumerOptions options, @Nonnull MessageMetadata.Layer metadata, @Nonnull Policy policy) throws IOException, org.bouncycastle.openpgp.PGPException - Throws:
IOExceptionorg.bouncycastle.openpgp.PGPException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
getMetadata
Description copied from class:DecryptionStreamReturnmetadataabout the decrypted / verified message. TheDecryptionStreamMUST be closed viaInputStream.close()before the metadata object can be accessed.- Specified by:
getMetadatain classDecryptionStream- Returns:
- message metadata
-