Package org.keycloak.jose.jwe.enc
Class AesCbcHmacShaEncryptionProvider
java.lang.Object
org.keycloak.jose.jwe.enc.AesCbcHmacShaEncryptionProvider
- All Implemented Interfaces:
JWEEncryptionProvider
- Direct Known Subclasses:
AesCbcHmacShaEncryptionProvider.Aes128CbcHmacSha256Provider,AesCbcHmacShaEncryptionProvider.Aes192CbcHmacSha384Provider,AesCbcHmacShaEncryptionProvider.Aes256CbcHmacSha512Provider,AesCbcHmacShaJWEEncryptionProvider
public abstract class AesCbcHmacShaEncryptionProvider
extends Object
implements JWEEncryptionProvider
- Author:
- Marek Posolda
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeCEK(JWEKeyStorage keyStorage) This method is supposed to deserialize keys.voidThis method usually has 3 outputs: - generated initialization vector - encrypted content - authenticationTag for MAC validation It is supposed to callJWE.setEncryptedContentInfo(byte[], byte[], byte[])after it's finishedprotected abstract intprotected abstract intprotected abstract Stringbyte[]serializeCEK(JWEKeyStorage keyStorage) This method requires that decoded CEK keys are present in the keyStorage.decodedCEK map before it's calledvoidverifyAndDecodeJwe(JWE jwe) This method is supposed to verify checksums and decrypt content.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.jose.jwe.enc.JWEEncryptionProvider
getExpectedCEKLength
-
Constructor Details
-
AesCbcHmacShaEncryptionProvider
public AesCbcHmacShaEncryptionProvider()
-
-
Method Details
-
encodeJwe
Description copied from interface:JWEEncryptionProviderThis method usually has 3 outputs: - generated initialization vector - encrypted content - authenticationTag for MAC validation It is supposed to callJWE.setEncryptedContentInfo(byte[], byte[], byte[])after it's finished- Specified by:
encodeJwein interfaceJWEEncryptionProvider- Throws:
IOExceptionGeneralSecurityException
-
verifyAndDecodeJwe
Description copied from interface:JWEEncryptionProviderThis method is supposed to verify checksums and decrypt content. Then it needs to callJWE.content(byte[])after it's finished- Specified by:
verifyAndDecodeJwein interfaceJWEEncryptionProvider- Throws:
IOExceptionGeneralSecurityException
-
getExpectedAesKeyLength
protected abstract int getExpectedAesKeyLength() -
getHmacShaAlgorithm
-
getAuthenticationTagLength
protected abstract int getAuthenticationTagLength() -
deserializeCEK
Description copied from interface:JWEEncryptionProviderThis method is supposed to deserialize keys. It requires thatJWEKeyStorage.getCekBytes()is set. After keys are deserialized, this method needs to callJWEKeyStorage.setCEKKey(Key, JWEKeyStorage.KeyUse)according to all uses, which this encryption algorithm requires.- Specified by:
deserializeCEKin interfaceJWEEncryptionProvider
-
serializeCEK
Description copied from interface:JWEEncryptionProviderThis method requires that decoded CEK keys are present in the keyStorage.decodedCEK map before it's called- Specified by:
serializeCEKin interfaceJWEEncryptionProvider- Returns:
-