| Modifier and Type | Field and Description |
|---|---|
static ThreadLocalCipher |
CIPHER |
static String |
CIPHER_NAME
The underlying block cipher.
|
| Constructor and Description |
|---|
CCMBlockCipher() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] crypted,
int numAuthenticationBytes)
See RFC 3610
for details.
|
static byte[] |
decrypt(SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] crypted,
int cryptedOffset,
int cryptedLength,
int numAuthenticationBytes)
See RFC 3610
for details.
|
static byte[] |
encrypt(int outputOffset,
SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] message,
int numAuthenticationBytes)
See RFC 3610
for details.
|
static byte[] |
encrypt(SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] message,
int numAuthenticationBytes)
See RFC 3610
for details.
|
public static final String CIPHER_NAME
public static final ThreadLocalCipher CIPHER
public static final byte[] decrypt(SecretKey key, byte[] nonce, byte[] additionalData, byte[] crypted, int numAuthenticationBytes) throws GeneralSecurityException
key - the encryption key K.nonce - the nonce N.additionalData - the additional authenticated data a.crypted - the encrypted and authenticated message c.numAuthenticationBytes - Number of octets in authentication field.GeneralSecurityException - if the message could not be de-crypted,
e.g. because the ciphertext's block size is not correctInvalidMacException - if the message could not be authenticatedpublic static final byte[] decrypt(SecretKey key, byte[] nonce, byte[] additionalData, byte[] crypted, int cryptedOffset, int cryptedLength, int numAuthenticationBytes) throws GeneralSecurityException
key - the encryption key K.nonce - the nonce N.additionalData - the additional authenticated data a.crypted - the encrypted and authenticated message c.cryptedOffset - offset within cryptedcryptedLength - length within cryptednumAuthenticationBytes - Number of octets in authentication field.GeneralSecurityException - if the message could not be de-crypted,
e.g. because the ciphertext's block size is not correctInvalidMacException - if the message could not be authenticatedpublic static final byte[] encrypt(SecretKey key, byte[] nonce, byte[] additionalData, byte[] message, int numAuthenticationBytes) throws GeneralSecurityException
key - the encryption key K.nonce - the nonce N.additionalData - the additional authenticated data a.message - the message to authenticate and encrypt.numAuthenticationBytes - Number of octets in authentication field.GeneralSecurityException - if the data could not be encrypted, e.g.
because the JVM does not support the AES cipher algorithmpublic static final byte[] encrypt(int outputOffset,
SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] message,
int numAuthenticationBytes)
throws GeneralSecurityException
outputOffset - offset of the encrypted message within the resulting byte
array. Leaves space for the explicit nonce.key - the encryption key K.nonce - the nonce N.additionalData - the additional authenticated data a.message - the message to authenticate and encrypt.numAuthenticationBytes - Number of octets in authentication field.GeneralSecurityException - if the data could not be encrypted, e.g.
because the JVM does not support the AES cipher algorithmCopyright © 2023 Eclipse Foundation. All rights reserved.