Class ProducerOptions
- java.lang.Object
-
- org.pgpainless.encryption_signing.ProducerOptions
-
public final class ProducerOptions extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProducerOptionsencrypt(EncryptionOptions encryptionOptions)Encrypt some data without signing.CompressionAlgorithmgetCompressionAlgorithmOverride()StreamEncodinggetEncoding()EncryptionOptionsgetEncryptionOptions()StringgetFileName()Return the encrypted files name.DategetModificationDate()Return the modification date of the encrypted file.SigningOptionsgetSigningOptions()booleanisAsciiArmor()Return true if the output of the encryption/signing operation shall be ascii armored.booleanisCleartextSigned()static ProducerOptionsnoEncryptionNoSigning()ProducerOptionsoverrideCompressionAlgorithm(CompressionAlgorithm compressionAlgorithm)Override which compression algorithm shall be used.ProducerOptionssetAsciiArmor(boolean asciiArmor)Specify, whether the result of the encryption/signing operation shall be ascii armored.ProducerOptionssetCleartextSigned()ProducerOptionssetEncoding(StreamEncoding encoding)Set the format of the literal data packet.ProducerOptionssetFileName(String fileName)Set the name of the encrypted file.ProducerOptionssetForYourEyesOnly()Mark the encrypted message as for-your-eyes-only by setting a special file name.ProducerOptionssetModificationDate(Date modificationDate)Set the modification date of the encrypted file.static ProducerOptionssign(SigningOptions signingOptions)Sign some data without encryption.static ProducerOptionssignAndEncrypt(EncryptionOptions encryptionOptions, SigningOptions signingOptions)Sign and encrypt some data.
-
-
-
Method Detail
-
signAndEncrypt
public static ProducerOptions signAndEncrypt(EncryptionOptions encryptionOptions, SigningOptions signingOptions)
Sign and encrypt some data.- Parameters:
encryptionOptions- encryption optionssigningOptions- signing options- Returns:
- builder
-
sign
public static ProducerOptions sign(SigningOptions signingOptions)
Sign some data without encryption.- Parameters:
signingOptions- signing options- Returns:
- builder
-
encrypt
public static ProducerOptions encrypt(EncryptionOptions encryptionOptions)
Encrypt some data without signing.- Parameters:
encryptionOptions- encryption options- Returns:
- builder
-
noEncryptionNoSigning
public static ProducerOptions noEncryptionNoSigning()
-
setAsciiArmor
public ProducerOptions setAsciiArmor(boolean asciiArmor)
Specify, whether the result of the encryption/signing operation shall be ascii armored. The default value is true.- Parameters:
asciiArmor- ascii armor- Returns:
- builder
-
isAsciiArmor
public boolean isAsciiArmor()
Return true if the output of the encryption/signing operation shall be ascii armored.- Returns:
- ascii armored
-
setCleartextSigned
public ProducerOptions setCleartextSigned()
-
isCleartextSigned
public boolean isCleartextSigned()
-
setFileName
public ProducerOptions setFileName(@Nonnull String fileName)
Set the name of the encrypted file. Note: This option cannot be used simultaneously withsetForYourEyesOnly().- Parameters:
fileName- name of the encrypted file- Returns:
- this
-
getFileName
public String getFileName()
Return the encrypted files name.- Returns:
- file name
-
setForYourEyesOnly
public ProducerOptions setForYourEyesOnly()
Mark the encrypted message as for-your-eyes-only by setting a special file name. Note: Therefore this method cannot be used simultaneously withsetFileName(String).- Returns:
- this
-
setModificationDate
public ProducerOptions setModificationDate(@Nonnull Date modificationDate)
Set the modification date of the encrypted file.- Parameters:
modificationDate- Modification date of the encrypted file.- Returns:
- this
-
getModificationDate
public Date getModificationDate()
Return the modification date of the encrypted file.- Returns:
- modification date
-
setEncoding
public ProducerOptions setEncoding(@Nonnull StreamEncoding encoding)
Set the format of the literal data packet. Defaults toStreamEncoding.BINARY.- Parameters:
encoding- encoding- Returns:
- this
- See Also:
- RFC4880 ยง5.9. Literal Data Packet
-
getEncoding
public StreamEncoding getEncoding()
-
overrideCompressionAlgorithm
public ProducerOptions overrideCompressionAlgorithm(CompressionAlgorithm compressionAlgorithm)
Override which compression algorithm shall be used.- Parameters:
compressionAlgorithm- compression algorithm override- Returns:
- builder
-
getCompressionAlgorithmOverride
public CompressionAlgorithm getCompressionAlgorithmOverride()
-
getEncryptionOptions
@Nullable public EncryptionOptions getEncryptionOptions()
-
getSigningOptions
@Nullable public SigningOptions getSigningOptions()
-
-