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.DecryptverifyNotAfter(Date timestamp)Makes the SOP consider signatures after this date invalid.DecryptverifyNotBefore(Date timestamp)Makes the SOP consider signatures before this date invalid.default DecryptverifyWithCert(byte[] cert)Adds the verification cert.DecryptverifyWithCert(InputStream cert)Adds the verification cert.default DecryptwithKey(byte[] key)Adds the decryption key.DecryptwithKey(InputStream key)Adds the decryption key.DecryptwithPassword(String password)Tries to decrypt with the given password.DecryptwithSessionKey(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.BadDataIOException
-
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.BadDataIOException
-
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.PasswordNotHumanReadableSOPGPException.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.KeyIsProtectedSOPGPException.BadDataSOPGPException.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.KeyIsProtectedSOPGPException.BadDataSOPGPException.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.BadDataSOPGPException.MissingArgSOPGPException.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.BadDataSOPGPException.MissingArgSOPGPException.CannotDecrypt
-
-