Package org.jose4j.jwe
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
FieldsModifier and TypeFieldDescriptionprivate final ContentEncryptionKeyDescriptorprivate final Stringstatic final intprivate final intFields inherited from class org.jose4j.jwa.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) (package private) ContentEncryptionPartsencrypt(byte[] plaintext, byte[] aad, byte[] key, byte[] iv, Headers headers, ProviderContext providerContext) encrypt(byte[] plaintext, byte[] aad, byte[] contentEncryptionKey, Headers headers, byte[] ivOverride, ProviderContext providerContext) private byte[]getAdditionalAuthenticatedDataLengthBytes(byte[] additionalAuthenticatedData) intbooleanMethods inherited from class org.jose4j.jwa.AlgorithmInfo
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType, setAlgorithmIdentifier, setJavaAlgorithm, setKeyPersuasion, setKeyType, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jose4j.jwa.Algorithm
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType
-
Field Details
-
IV_BYTE_LENGTH
public static final int IV_BYTE_LENGTH- See Also:
-
hmacJavaAlgorithm
-
tagTruncationLength
private final int tagTruncationLength -
contentEncryptionKeyDescriptor
-
-
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
-
encrypt
ContentEncryptionParts encrypt(byte[] plaintext, byte[] aad, byte[] key, byte[] iv, Headers headers, ProviderContext providerContext) throws JoseException - Throws:
JoseException
-
decrypt
public byte[] decrypt(ContentEncryptionParts contentEncryptionParts, byte[] aad, byte[] contentEncryptionKey, Headers headers, ProviderContext providerContext) throws JoseException - Specified by:
decryptin interfaceContentEncryptionAlgorithm- Throws:
JoseException
-
getAdditionalAuthenticatedDataLengthBytes
private byte[] getAdditionalAuthenticatedDataLengthBytes(byte[] additionalAuthenticatedData) -
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceAlgorithm
-