public class AeadBlockCipher extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AES_CCM
Support java prior 1.7, aes-ccm is a non-java-vm transformation and
handled as special transformation.
|
| Constructor and Description |
|---|
AeadBlockCipher() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(CipherSuite suite,
SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] crypted,
int cryptedOffset,
int cryptedLength)
Decrypt with AEAD cipher.
|
static byte[] |
encrypt(int outputOffset,
CipherSuite suite,
SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] message)
Encrypt with AEAD cipher.
|
static boolean |
isSupported(String transformation,
int keyLength)
Test, if cipher is supported.
|
public static final String AES_CCM
CCMBlockCipher,
Constant Field Valuespublic static final boolean isSupported(String transformation, int keyLength)
transformation - name of cipherkeyLength - key length in bytestrue, if supportedpublic static final byte[] decrypt(CipherSuite suite, SecretKey key, byte[] nonce, byte[] additionalData, byte[] crypted, int cryptedOffset, int cryptedLength) throws GeneralSecurityException
suite - the cipher suitekey - the encryption key K.nonce - the nonce N.additionalData - the additional authenticated data a.crypted - the encrypted and authenticated message c.cryptedOffset - the offset within crypted.cryptedLength - the length within crypted.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(int outputOffset,
CipherSuite suite,
SecretKey key,
byte[] nonce,
byte[] additionalData,
byte[] message)
throws GeneralSecurityException
outputOffset - offset of the encrypted message within the resulting byte
array. Leaves space for the explicit nonce.suite - the cipher suitekey - the encryption key K.nonce - the nonce N.additionalData - the additional authenticated data a.message - the message to authenticate and encrypt.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.