Package org.pgpainless.sop
Class DecryptImpl
- java.lang.Object
-
- org.pgpainless.sop.DecryptImpl
-
- All Implemented Interfaces:
Decrypt
public class DecryptImpl extends Object implements Decrypt
-
-
Constructor Summary
Constructors Constructor Description DecryptImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReadyWithResult<DecryptionResult>
ciphertext(InputStream ciphertext)
Decrypts the given ciphertext, returning verification results and plaintext.DecryptImpl
verifyNotAfter(Date timestamp)
Makes the SOP consider signatures after this date invalid.DecryptImpl
verifyNotBefore(Date timestamp)
Makes the SOP consider signatures before this date invalid.DecryptImpl
verifyWithCert(InputStream certIn)
Adds the verification cert.DecryptImpl
withKey(InputStream keyIn)
Adds the decryption key.DecryptImpl
withPassword(String password)
Tries to decrypt with the given password.DecryptImpl
withSessionKey(SessionKey sessionKey)
Tries to decrypt with the given session key.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface sop.operation.Decrypt
ciphertext, verifyWithCert, withKey
-
-
-
-
Constructor Detail
-
DecryptImpl
public DecryptImpl()
-
-
Method Detail
-
verifyNotBefore
public DecryptImpl verifyNotBefore(Date timestamp) throws SOPGPException.UnsupportedOption
Description copied from interface:Decrypt
Makes the SOP consider signatures before this date invalid.- Specified by:
verifyNotBefore
in interfaceDecrypt
- Parameters:
timestamp
- timestamp- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
verifyNotAfter
public DecryptImpl verifyNotAfter(Date timestamp) throws SOPGPException.UnsupportedOption
Description copied from interface:Decrypt
Makes the SOP consider signatures after this date invalid.- Specified by:
verifyNotAfter
in interfaceDecrypt
- Parameters:
timestamp
- timestamp- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
verifyWithCert
public DecryptImpl verifyWithCert(InputStream certIn) throws SOPGPException.BadData, IOException
Description copied from interface:Decrypt
Adds the verification cert.- Specified by:
verifyWithCert
in interfaceDecrypt
- Parameters:
certIn
- input stream containing the cert- Returns:
- builder instance
- Throws:
SOPGPException.BadData
IOException
-
withSessionKey
public DecryptImpl withSessionKey(SessionKey sessionKey) throws SOPGPException.UnsupportedOption
Description copied from interface:Decrypt
Tries to decrypt with the given session key.- Specified by:
withSessionKey
in interfaceDecrypt
- Parameters:
sessionKey
- session key- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
withPassword
public DecryptImpl withPassword(String password)
Description copied from interface:Decrypt
Tries to decrypt with the given password.- Specified by:
withPassword
in interfaceDecrypt
- Parameters:
password
- password- Returns:
- builder instance
-
withKey
public DecryptImpl withKey(InputStream keyIn) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, SOPGPException.UnsupportedAsymmetricAlgo
Description copied from interface:Decrypt
Adds the decryption key.- Specified by:
withKey
in interfaceDecrypt
- Parameters:
keyIn
- input stream containing the key- Returns:
- builder instance
- Throws:
SOPGPException.KeyIsProtected
SOPGPException.BadData
SOPGPException.UnsupportedAsymmetricAlgo
-
ciphertext
public ReadyWithResult<DecryptionResult> ciphertext(InputStream ciphertext) throws SOPGPException.BadData, SOPGPException.MissingArg
Description copied from interface:Decrypt
Decrypts the given ciphertext, returning verification results and plaintext.- Specified by:
ciphertext
in interfaceDecrypt
- Parameters:
ciphertext
- ciphertext- Returns:
- ready with result
- Throws:
SOPGPException.BadData
SOPGPException.MissingArg
-
-