public enum EncryptionMethod extends Enum<EncryptionMethod>
Enum Constant and Description |
---|
A128CBC_HS256
AES encryption in CBC mode with PKCS5 Padding and a 128 bit length, AES encryption for CEK, HMAC using SHA-256
hash algorithm for authentication tag.
|
A128GCM
AES encryption in Galois Counter Mode (GCM) with a 128 bit key length.
|
A192CBC_HS384
AES encryption in CBC mode with PKCS5 Padding and a 192 bit length, AES encryption for CEK, HMAC using SHA-384
hash algorithm for the authentication tag.
|
A192GCM
AES encryption in Galois Counter Mode (GCM) with a 192 bit key length.
|
A256CBC_HS512
AES encryption in CBC mode with PKCS5 Padding and a 256 bit length, AES encryption for CEK, HMAC using SHA-256
hash algorithm for authentication tag.
|
A256GCM
AES encryption in Galois Counter Mode (GCM) with a 256 bit key length.
|
CC20_P1305
The ChaCha20-Poly1305 algorithm as described in RFC
7539.
|
XC20_P1305
The XChaCha20-Poly1305 algorithm as used in libsodium, Wireguard, etc.
|
Modifier and Type | Method and Description |
---|---|
String |
getEncryptionAlgorithm()
Gets the Java Cryptographic algorithm name for the algorithm that will create the Content Encryption Key (CEK).
|
String |
getJweStandardName()
Returns the JWE standard encryption method name for this encryption method.
|
int |
getKeyOffset()
Gets the number of octets in each of the CEK and MAC key.
|
int |
getKeySize()
Gets the bit length of the Content Encryption Key (CEK).
|
String |
getMacAlgorithm()
Gets the Java Cryptographic algorithm name for the algorithm that will generate the MAC key.
|
String |
getName()
Gets the full name of the encryption method.
|
String |
getTransformation()
Gets the Java Cryptographic algorithm name for the algorithm that will eb used to encrypt the plaintext.
|
static EncryptionMethod |
parseMethod(String method)
Parses the given algorithm string to find the matching EncryptionMethod enum constant.
|
String |
toString()
Turns the EncryptionMethod constant into a JSON value string.
|
static EncryptionMethod |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EncryptionMethod[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EncryptionMethod A128CBC_HS256
public static final EncryptionMethod A192CBC_HS384
public static final EncryptionMethod A256CBC_HS512
public static final EncryptionMethod A128GCM
public static final EncryptionMethod A192GCM
public static final EncryptionMethod A256GCM
public static final EncryptionMethod CC20_P1305
public static final EncryptionMethod XC20_P1305
CC20_P1305
that takes a 192-bit random nonce and
uses the first 128-bits to derive a unique per-message key. The remaining bytes of the nonce and the fresh key
are then used with CC20_P1305
. This allows using random nonces, which are much easier to generate
safely, for encrypting up to 280 messages with the same key.public static EncryptionMethod[] values()
for (EncryptionMethod c : EncryptionMethod.values()) System.out.println(c);
public static EncryptionMethod valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getName()
public String getTransformation()
public String getMacAlgorithm()
public String getEncryptionAlgorithm()
public int getKeyOffset()
public int getKeySize()
public static EncryptionMethod parseMethod(String method)
method
- The encryption method.public String getJweStandardName()
public String toString()
toString
in class Enum<EncryptionMethod>
Copyright 2010-2022 ForgeRock AS.