public class AesGcmKeyAlgorithm extends Object implements SecretKeyAlgorithm
| Modifier and Type | Field and Description |
|---|---|
protected static int |
BLOCK_BYTE_SIZE |
protected static int |
BLOCK_SIZE |
protected static String |
DECRYPT_NO_IV |
protected boolean |
gcm |
protected static int |
GCM_IV_SIZE |
protected int |
ivBitLength |
protected static String |
KEY_ALG_NAME |
protected int |
keyBitLength |
protected int |
tagBitLength |
static String |
TRANSFORMATION |
| Constructor and Description |
|---|
AesGcmKeyAlgorithm(int keyLen) |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
assertBytes(byte[] bytes,
String type,
int requiredBitLen) |
protected SecretKey |
assertKey(SecretKey key) |
protected byte[] |
ensureInitializationVector(Request<?> request) |
boolean |
equals(Object obj) |
protected SecretKey |
generateCek(KeyRequest<?> request) |
SecretKey |
getDecryptionKey(DecryptionKeyRequest<SecretKey> request) |
KeyResult |
getEncryptionKey(KeyRequest<SecretKey> request) |
String |
getId() |
protected AlgorithmParameterSpec |
getIvSpec(byte[] iv) |
protected String |
getJcaName(Request<?> request) |
int |
getKeyBitLength() |
int |
hashCode() |
protected JcaTemplate |
jca() |
protected JcaTemplate |
jca(Request<?> request) |
SecretKeyBuilder |
key() |
protected static String |
lengthMsg(String id,
String type,
int requiredLengthInBits,
long actualLengthInBits) |
String |
toString() |
protected byte[] |
validateLength(SecretKey key,
int requiredBitLength,
boolean propagate) |
protected byte[] |
withCipher(Cipher cipher,
InputStream in,
InputStream aad,
OutputStream out) |
protected void |
withCipher(Cipher cipher,
InputStream in,
OutputStream out) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetIdkeygetKeyBitLengthpublic static final String TRANSFORMATION
protected static final String KEY_ALG_NAME
protected static final int BLOCK_SIZE
protected static final int BLOCK_BYTE_SIZE
protected static final int GCM_IV_SIZE
protected static final String DECRYPT_NO_IV
protected final int keyBitLength
protected final int ivBitLength
protected final int tagBitLength
protected final boolean gcm
public KeyResult getEncryptionKey(KeyRequest<SecretKey> request) throws SecurityException
getEncryptionKey in interface KeyAlgorithm<SecretKey,SecretKey>SecurityExceptionpublic SecretKey getDecryptionKey(DecryptionKeyRequest<SecretKey> request) throws SecurityException
getDecryptionKey in interface KeyAlgorithm<SecretKey,SecretKey>SecurityExceptionpublic int getKeyBitLength()
getKeyBitLength in interface KeyLengthSupplierpublic SecretKeyBuilder key()
key in interface KeyBuilderSupplier<SecretKey,SecretKeyBuilder>protected static String lengthMsg(String id, String type, int requiredLengthInBits, long actualLengthInBits)
protected byte[] validateLength(SecretKey key, int requiredBitLength, boolean propagate)
protected byte[] assertBytes(byte[] bytes,
String type,
int requiredBitLen)
protected byte[] ensureInitializationVector(Request<?> request)
protected AlgorithmParameterSpec getIvSpec(byte[] iv)
protected void withCipher(Cipher cipher, InputStream in, OutputStream out) throws Exception
Exceptionprotected byte[] withCipher(Cipher cipher, InputStream in, InputStream aad, OutputStream out) throws Exception
Exceptionpublic String getId()
getId in interface Identifiableprotected JcaTemplate jca()
protected JcaTemplate jca(Request<?> request)
protected SecretKey generateCek(KeyRequest<?> request)
Copyright © 2014–2024 jsonwebtoken.io. All rights reserved.