Class AesCbcHmacSha2ContentEncryptionAlgorithm
java.lang.Object
org.jose4j.jwa.AlgorithmInfo
org.jose4j.jwe.AesCbcHmacSha2ContentEncryptionAlgorithm
- All Implemented Interfaces:
Algorithm, ContentEncryptionAlgorithm
- Direct Known Subclasses:
AesCbcHmacSha2ContentEncryptionAlgorithm.Aes128CbcHmacSha256, AesCbcHmacSha2ContentEncryptionAlgorithm.Aes192CbcHmacSha384, AesCbcHmacSha2ContentEncryptionAlgorithm.Aes256CbcHmacSha512
public class AesCbcHmacSha2ContentEncryptionAlgorithm
extends AlgorithmInfo
implements ContentEncryptionAlgorithm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsFields inherited from class AlgorithmInfo
log -
Constructor Summary
ConstructorsConstructorDescriptionAesCbcHmacSha2ContentEncryptionAlgorithm(String alg, int cekByteLen, String javaHmacAlg, int tagTruncationLength) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(ContentEncryptionParts contentEncryptionParts, byte[] aad, byte[] contentEncryptionKey, Headers headers, ProviderContext providerContext) encrypt(byte[] plaintext, byte[] aad, byte[] contentEncryptionKey, Headers headers, byte[] ivOverride, ProviderContext providerContext) intbooleanMethods inherited from class AlgorithmInfo
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType, setAlgorithmIdentifier, setJavaAlgorithm, setKeyPersuasion, setKeyType, toStringModifier and TypeMethodDescriptionvoidsetAlgorithmIdentifier(String algorithmIdentifier) voidsetJavaAlgorithm(String javaAlgorithm) voidsetKeyPersuasion(KeyPersuasion keyPersuasion) voidsetKeyType(String keyType) toString()
-
Field Details
-
IV_BYTE_LENGTH
public static final int IV_BYTE_LENGTH- See Also:
-
-
Constructor Details
-
AesCbcHmacSha2ContentEncryptionAlgorithm
-
-
Method Details
-
getHmacJavaAlgorithm
-
getTagTruncationLength
public int getTagTruncationLength() -
getContentEncryptionKeyDescriptor
- Specified by:
getContentEncryptionKeyDescriptorin interfaceContentEncryptionAlgorithm
-
encrypt
public ContentEncryptionParts encrypt(byte[] plaintext, byte[] aad, byte[] contentEncryptionKey, Headers headers, byte[] ivOverride, ProviderContext providerContext) throws JoseException - Specified by:
encryptin interfaceContentEncryptionAlgorithm- Throws:
JoseException
-
decrypt
public byte[] decrypt(ContentEncryptionParts contentEncryptionParts, byte[] aad, byte[] contentEncryptionKey, Headers headers, ProviderContext providerContext) throws JoseException - Specified by:
decryptin interfaceContentEncryptionAlgorithm- Throws:
JoseException
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceAlgorithm
-