Package sop.operation
Interface Decrypt
-
- All Known Implementing Classes:
DecryptImpl
public interface Decrypt
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ReadyWithResult<DecryptionResult>
ciphertext(byte[] ciphertext)
Decrypts the given ciphertext, returning verification results and plaintext.ReadyWithResult<DecryptionResult>
ciphertext(InputStream ciphertext)
Decrypts the given ciphertext, returning verification results and plaintext.Decrypt
verifyNotAfter(Date timestamp)
Makes the SOP consider signatures after this date invalid.Decrypt
verifyNotBefore(Date timestamp)
Makes the SOP consider signatures before this date invalid.default Decrypt
verifyWithCert(byte[] cert)
Adds the verification cert.Decrypt
verifyWithCert(InputStream cert)
Adds the verification cert.default Decrypt
withKey(byte[] key)
Adds the decryption key.Decrypt
withKey(InputStream key)
Adds the decryption key.Decrypt
withPassword(String password)
Tries to decrypt with the given password.Decrypt
withSessionKey(SessionKey sessionKey)
Tries to decrypt with the given session key.
-
-
-
Method Detail
-
verifyNotBefore
Decrypt verifyNotBefore(Date timestamp) throws SOPGPException.UnsupportedOption
Makes the SOP consider signatures before this date invalid.- Parameters:
timestamp
- timestamp- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
verifyNotAfter
Decrypt verifyNotAfter(Date timestamp) throws SOPGPException.UnsupportedOption
Makes the SOP consider signatures after this date invalid.- Parameters:
timestamp
- timestamp- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
verifyWithCert
Decrypt verifyWithCert(InputStream cert) throws SOPGPException.BadData, IOException
Adds the verification cert.- Parameters:
cert
- input stream containing the cert- Returns:
- builder instance
- Throws:
SOPGPException.BadData
IOException
-
verifyWithCert
default Decrypt verifyWithCert(byte[] cert) throws SOPGPException.BadData, IOException
Adds the verification cert.- Parameters:
cert
- byte array containing the cert- Returns:
- builder instance
- Throws:
SOPGPException.BadData
IOException
-
withSessionKey
Decrypt withSessionKey(SessionKey sessionKey) throws SOPGPException.UnsupportedOption
Tries to decrypt with the given session key.- Parameters:
sessionKey
- session key- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
withPassword
Decrypt withPassword(String password) throws SOPGPException.PasswordNotHumanReadable, SOPGPException.UnsupportedOption
Tries to decrypt with the given password.- Parameters:
password
- password- Returns:
- builder instance
- Throws:
SOPGPException.PasswordNotHumanReadable
SOPGPException.UnsupportedOption
-
withKey
Decrypt withKey(InputStream key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, SOPGPException.UnsupportedAsymmetricAlgo
Adds the decryption key.- Parameters:
key
- input stream containing the key- Returns:
- builder instance
- Throws:
SOPGPException.KeyIsProtected
SOPGPException.BadData
SOPGPException.UnsupportedAsymmetricAlgo
-
withKey
default Decrypt withKey(byte[] key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, SOPGPException.UnsupportedAsymmetricAlgo
Adds the decryption key.- Parameters:
key
- byte array containing the key- Returns:
- builder instance
- Throws:
SOPGPException.KeyIsProtected
SOPGPException.BadData
SOPGPException.UnsupportedAsymmetricAlgo
-
ciphertext
ReadyWithResult<DecryptionResult> ciphertext(InputStream ciphertext) throws SOPGPException.BadData, SOPGPException.MissingArg, SOPGPException.CannotDecrypt
Decrypts the given ciphertext, returning verification results and plaintext.- Parameters:
ciphertext
- ciphertext- Returns:
- ready with result
- Throws:
SOPGPException.BadData
SOPGPException.MissingArg
SOPGPException.CannotDecrypt
-
ciphertext
default ReadyWithResult<DecryptionResult> ciphertext(byte[] ciphertext) throws SOPGPException.BadData, SOPGPException.MissingArg, SOPGPException.CannotDecrypt
Decrypts the given ciphertext, returning verification results and plaintext.- Parameters:
ciphertext
- ciphertext- Returns:
- ready with result
- Throws:
SOPGPException.BadData
SOPGPException.MissingArg
SOPGPException.CannotDecrypt
-
-