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 Encryptmode(EncryptAs mode)Sets encryption mode.EncryptnoArmor()Disable ASCII armor encoding.Readyplaintext(InputStream plaintext)Encrypt the given data yielding the ciphertext.EncryptsignWith(InputStream keyIn)Adds the signer key.EncryptwithCert(InputStream cert)Encrypt with the given cert.EncryptwithPassword(String password)Encrypt with the given password.
-
-
-
Constructor Detail
-
EncryptImpl
public EncryptImpl()
-
-
Method Detail
-
noArmor
public Encrypt noArmor()
Description copied from interface:EncryptDisable ASCII armor encoding.
-
mode
public Encrypt mode(EncryptAs mode) throws SOPGPException.UnsupportedOption
Description copied from interface:EncryptSets encryption mode.- Specified by:
modein 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:EncryptAdds the signer key.- Specified by:
signWithin interfaceEncrypt- Parameters:
keyIn- input stream containing the encoded signer key- Returns:
- builder instance
- Throws:
SOPGPException.KeyIsProtectedSOPGPException.CertCannotSignSOPGPException.UnsupportedAsymmetricAlgoSOPGPException.BadData
-
withPassword
public Encrypt withPassword(String password) throws SOPGPException.PasswordNotHumanReadable, SOPGPException.UnsupportedOption
Description copied from interface:EncryptEncrypt with the given password.- Specified by:
withPasswordin interfaceEncrypt- Parameters:
password- password- Returns:
- builder instance
- Throws:
SOPGPException.PasswordNotHumanReadableSOPGPException.UnsupportedOption
-
withCert
public Encrypt withCert(InputStream cert) throws SOPGPException.CertCannotEncrypt, SOPGPException.UnsupportedAsymmetricAlgo, SOPGPException.BadData
Description copied from interface:EncryptEncrypt with the given cert.- Specified by:
withCertin interfaceEncrypt- Parameters:
cert- input stream containing the encoded cert.- Returns:
- builder instance
- Throws:
SOPGPException.CertCannotEncryptSOPGPException.UnsupportedAsymmetricAlgoSOPGPException.BadData
-
plaintext
public Ready plaintext(InputStream plaintext) throws IOException
Description copied from interface:EncryptEncrypt the given data yielding the ciphertext.- Specified by:
plaintextin interfaceEncrypt- Parameters:
plaintext- plaintext- Returns:
- input stream containing the ciphertext
- Throws:
IOException
-
-