Package sop.operation
Interface Encrypt
-
public interface Encrypt
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Encrypt
mode(EncryptAs mode)
Sets encryption mode.Encrypt
noArmor()
Disable ASCII armor encoding.default Ready
plaintext(byte[] plaintext)
Encrypt the given data yielding the ciphertext.Ready
plaintext(java.io.InputStream plaintext)
Encrypt the given data yielding the ciphertext.default Encrypt
signWith(byte[] key)
Adds the signer key.Encrypt
signWith(java.io.InputStream key)
Adds the signer key.default Encrypt
withCert(byte[] cert)
Encrypt with the given cert.Encrypt
withCert(java.io.InputStream cert)
Encrypt with the given cert.Encrypt
withPassword(java.lang.String password)
Encrypt with the given password.
-
-
-
Method Detail
-
noArmor
Encrypt noArmor()
Disable ASCII armor encoding.- Returns:
- builder instance
-
mode
Encrypt mode(EncryptAs mode) throws SOPGPException.UnsupportedOption
Sets encryption mode.- Parameters:
mode
- mode- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
signWith
Encrypt signWith(java.io.InputStream key) throws SOPGPException.KeyIsProtected, SOPGPException.CertCannotSign, SOPGPException.UnsupportedAsymmetricAlgo, SOPGPException.BadData
Adds the signer key.- Parameters:
key
- input stream containing the encoded signer key- Returns:
- builder instance
- Throws:
SOPGPException.KeyIsProtected
SOPGPException.CertCannotSign
SOPGPException.UnsupportedAsymmetricAlgo
SOPGPException.BadData
-
signWith
default Encrypt signWith(byte[] key) throws SOPGPException.KeyIsProtected, SOPGPException.CertCannotSign, SOPGPException.UnsupportedAsymmetricAlgo, SOPGPException.BadData
Adds the signer key.- Parameters:
key
- byte array containing the encoded signer key- Returns:
- builder instance
- Throws:
SOPGPException.KeyIsProtected
SOPGPException.CertCannotSign
SOPGPException.UnsupportedAsymmetricAlgo
SOPGPException.BadData
-
withPassword
Encrypt withPassword(java.lang.String password) throws SOPGPException.PasswordNotHumanReadable, SOPGPException.UnsupportedOption
Encrypt with the given password.- Parameters:
password
- password- Returns:
- builder instance
- Throws:
SOPGPException.PasswordNotHumanReadable
SOPGPException.UnsupportedOption
-
withCert
Encrypt withCert(java.io.InputStream cert) throws SOPGPException.CertCannotEncrypt, SOPGPException.UnsupportedAsymmetricAlgo, SOPGPException.BadData
Encrypt with the given cert.- Parameters:
cert
- input stream containing the encoded cert.- Returns:
- builder instance
- Throws:
SOPGPException.CertCannotEncrypt
SOPGPException.UnsupportedAsymmetricAlgo
SOPGPException.BadData
-
withCert
default Encrypt withCert(byte[] cert) throws SOPGPException.CertCannotEncrypt, SOPGPException.UnsupportedAsymmetricAlgo, SOPGPException.BadData
Encrypt with the given cert.- Parameters:
cert
- byte array containing the encoded cert.- Returns:
- builder instance
- Throws:
SOPGPException.CertCannotEncrypt
SOPGPException.UnsupportedAsymmetricAlgo
SOPGPException.BadData
-
plaintext
Ready plaintext(java.io.InputStream plaintext) throws java.io.IOException
Encrypt the given data yielding the ciphertext.- Parameters:
plaintext
- plaintext- Returns:
- input stream containing the ciphertext
- Throws:
java.io.IOException
-
plaintext
default Ready plaintext(byte[] plaintext) throws java.io.IOException
Encrypt the given data yielding the ciphertext.- Parameters:
plaintext
- plaintext- Returns:
- input stream containing the ciphertext
- Throws:
java.io.IOException
-
-