Package org.bouncycastle.openpgp.api
Class MessageEncryptionMechanism
java.lang.Object
org.bouncycastle.openpgp.api.MessageEncryptionMechanism
Encryption mode (SEIPDv1 / SEIPDv2 / OED) and algorithms.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MessageEncryptionMechanismaead(int symmetricKeyAlgorithm, int aeadAlgorithm) The data will be AEAD-encrypted using the method described in RFC9580.static MessageEncryptionMechanismaead(PreferredAEADCiphersuites.Combination combination) booleanintgetMode()intinthashCode()static MessageEncryptionMechanismintegrityProtected(int symmetricKeyAlgorithm) The data will be encrypted and integrity protected using a SEIPDv1 packet.booleanReturn true, if the message will be encrypted.static MessageEncryptionMechanismlibrePgp(int symmetricKeyAlgorithm) The data will be OCB-encrypted as specified by the non-standard LibrePGP document.static MessageEncryptionMechanismThe data will not be encrypted.
-
Method Details
-
getMode
-
getSymmetricKeyAlgorithm
public int getSymmetricKeyAlgorithm() -
getAeadAlgorithm
public int getAeadAlgorithm() -
unencrypted
The data will not be encrypted. Useful for sign-only operations.- Returns:
- unencrypted encryption setup
-
integrityProtected
The data will be encrypted and integrity protected using a SEIPDv1 packet.- Parameters:
symmetricKeyAlgorithm- symmetric cipher algorithm for message encryption- Returns:
- sym. enc. integrity protected encryption setup
-
librePgp
The data will be OCB-encrypted as specified by the non-standard LibrePGP document.- Parameters:
symmetricKeyAlgorithm- symmetric key algorithm which will be combined with OCB to form an OCB-encrypted data packet- Returns:
- LibrePGP OCB encryption setup
-
aead
The data will be AEAD-encrypted using the method described in RFC9580.- Parameters:
symmetricKeyAlgorithm- symmetric cipher algorithmaeadAlgorithm- AEAD algorithm- Returns:
- AEAD encryption setup
-
aead
-
isEncrypted
public boolean isEncrypted()Return true, if the message will be encrypted.- Returns:
- is encrypted
-
hashCode
public int hashCode() -
equals
-