Package org.pgpainless.sop
Class EncryptImpl
- java.lang.Object
-
- org.pgpainless.sop.EncryptImpl
-
- All Implemented Interfaces:
Encrypt
public class EncryptImpl extends Object implements Encrypt
-
-
Constructor Summary
Constructors Constructor Description EncryptImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Encrypt
mode(EncryptAs mode)
Sets encryption mode.Encrypt
noArmor()
Disable ASCII armor encoding.Ready
plaintext(InputStream plaintext)
Encrypt the given data yielding the ciphertext.Encrypt
signWith(InputStream keyIn)
Adds the signer key.Encrypt
withCert(InputStream cert)
Encrypt with the given cert.Encrypt
withPassword(String password)
Encrypt with the given password.
-
-
-
Constructor Detail
-
EncryptImpl
public EncryptImpl()
-
-
Method Detail
-
noArmor
public Encrypt noArmor()
Description copied from interface:Encrypt
Disable ASCII armor encoding.
-
mode
public Encrypt mode(EncryptAs mode) throws SOPGPException.UnsupportedOption
Description copied from interface:Encrypt
Sets encryption mode.- Specified by:
mode
in interfaceEncrypt
- Parameters:
mode
- mode- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption
-
signWith
public Encrypt signWith(InputStream keyIn) throws SOPGPException.KeyIsProtected, SOPGPException.CertCannotSign, SOPGPException.UnsupportedAsymmetricAlgo, SOPGPException.BadData
Description copied from interface:Encrypt
Adds the signer key.- Specified by:
signWith
in interfaceEncrypt
- Parameters:
keyIn
- input stream containing the encoded signer key- Returns:
- builder instance
- Throws:
SOPGPException.KeyIsProtected
SOPGPException.CertCannotSign
SOPGPException.UnsupportedAsymmetricAlgo
SOPGPException.BadData
-
withPassword
public Encrypt withPassword(String password) throws SOPGPException.PasswordNotHumanReadable, SOPGPException.UnsupportedOption
Description copied from interface:Encrypt
Encrypt with the given password.- Specified by:
withPassword
in interfaceEncrypt
- Parameters:
password
- password- Returns:
- builder instance
- Throws:
SOPGPException.PasswordNotHumanReadable
SOPGPException.UnsupportedOption
-
withCert
public Encrypt withCert(InputStream cert) throws SOPGPException.CertCannotEncrypt, SOPGPException.UnsupportedAsymmetricAlgo, SOPGPException.BadData
Description copied from interface:Encrypt
Encrypt with the given cert.- Specified by:
withCert
in interfaceEncrypt
- Parameters:
cert
- input stream containing the encoded cert.- Returns:
- builder instance
- Throws:
SOPGPException.CertCannotEncrypt
SOPGPException.UnsupportedAsymmetricAlgo
SOPGPException.BadData
-
plaintext
public Ready plaintext(InputStream plaintext) throws IOException
Description copied from interface:Encrypt
Encrypt the given data yielding the ciphertext.- Specified by:
plaintext
in interfaceEncrypt
- Parameters:
plaintext
- plaintext- Returns:
- input stream containing the ciphertext
- Throws:
IOException
-
-