public enum CryptoAlgorithm extends Enum<CryptoAlgorithm>
Format: CryptoAlgorithm(block size, nonce length, tag length, max content length, key algo, key length, short value representing this algorithm, trailing signature alg, trailing signature length)
Enum Constant and Description |
---|
ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256
AES-GCM 128 with HKDF-SHA256
|
ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256
AES-GCM 128 with ECDSA (SHA256 with the secp256r1 curve)
|
ALG_AES_128_GCM_IV12_TAG16_NO_KDF
AES-GCM 128
|
ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256
AES-GCM 192
|
ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384
AES-GCM 192 with ECDSA (SHA384 with the secp384r1 curve)
|
ALG_AES_192_GCM_IV12_TAG16_NO_KDF
AES-GCM 192
|
ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256
AES-GCM 256
|
ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384
AES-GCM 256 with ECDSA (SHA384 with the secp384r1 curve)
|
ALG_AES_256_GCM_IV12_TAG16_NO_KDF
AES-GCM 256
|
Modifier and Type | Method and Description |
---|---|
static CryptoAlgorithm |
deserialize(short value)
Returns the CryptoAlgorithm object that matches the given value.
|
int |
getBlockSize()
Returns the block size of this algorithm in bytes.
|
String |
getDataKeyAlgo()
Returns the algorithm associated with the data key.
|
int |
getDataKeyLength()
Returns the length of the data key in bytes.
|
SecretKey |
getEncryptionKeyFromDataKey(SecretKey dataKey,
CiphertextHeaders headers) |
String |
getKeyAlgo()
Returns the algorithm used for encrypting the plaintext data.
|
int |
getKeyLength()
Returns the length of the key used in this algorithm in bytes.
|
long |
getMaxContentLen()
Returns the maximum content length in bytes that can be processed under a single data key in
this algorithm.
|
byte |
getNonceLen()
Returns the nonce length used in this algorithm in bytes.
|
int |
getTagLen()
Returns the tag length used in this algorithm in bytes.
|
String |
getTrailingSignatureAlgo()
Returns the algorithm used to calculate the trailing signature
|
short |
getTrailingSignatureLength()
Returns the length of the trailing signature generated by this algorithm.
|
short |
getValue()
Returns the value used to encode this algorithm in the ciphertext.
|
boolean |
isSafeToCache()
Returns whether data keys used with this crypto algorithm can safely be cached and reused for a different
message.
|
static CryptoAlgorithm |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CryptoAlgorithm[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CryptoAlgorithm ALG_AES_128_GCM_IV12_TAG16_NO_KDF
public static final CryptoAlgorithm ALG_AES_192_GCM_IV12_TAG16_NO_KDF
public static final CryptoAlgorithm ALG_AES_256_GCM_IV12_TAG16_NO_KDF
public static final CryptoAlgorithm ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256
public static final CryptoAlgorithm ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256
public static final CryptoAlgorithm ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256
public static final CryptoAlgorithm ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256
public static final CryptoAlgorithm ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384
public static final CryptoAlgorithm ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384
public static CryptoAlgorithm[] values()
for (CryptoAlgorithm c : CryptoAlgorithm.values()) System.out.println(c);
public static CryptoAlgorithm 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 static CryptoAlgorithm deserialize(short value)
value
- the value of the objectpublic int getBlockSize()
public byte getNonceLen()
public int getTagLen()
public long getMaxContentLen()
public String getKeyAlgo()
public int getKeyLength()
public short getValue()
public String getDataKeyAlgo()
public int getDataKeyLength()
public String getTrailingSignatureAlgo()
public boolean isSafeToCache()
public short getTrailingSignatureLength()
public SecretKey getEncryptionKeyFromDataKey(SecretKey dataKey, CiphertextHeaders headers) throws InvalidKeyException
InvalidKeyException
Copyright © 2018. All rights reserved.