Class AbstractJweEncryption
- java.lang.Object
-
- org.apache.cxf.rs.security.jose.jwe.AbstractJweEncryption
-
- All Implemented Interfaces:
JweEncryptionProvider,JweKeyProperties
- Direct Known Subclasses:
JweEncryption
public abstract class AbstractJweEncryption extends Object implements JweEncryptionProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractJweEncryption.JweEncryptionInternal
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_AUTH_TAG_LENGTHprotected static LoggerLOG
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractJweEncryption(ContentEncryptionProvider contentEncryptionAlgo, KeyEncryptionProvider keyEncryptionAlgo)
-
Method Summary
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
DEFAULT_AUTH_TAG_LENGTH
protected static final int DEFAULT_AUTH_TAG_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractJweEncryption
protected AbstractJweEncryption(ContentEncryptionProvider contentEncryptionAlgo, KeyEncryptionProvider keyEncryptionAlgo)
-
-
Method Detail
-
getContentEncryptionAlgorithm
protected ContentEncryptionProvider getContentEncryptionAlgorithm()
-
getAlgorithmParameterSpec
protected AlgorithmParameterSpec getAlgorithmParameterSpec(byte[] theIv)
-
getContentEncryptionKey
protected byte[] getContentEncryptionKey(JweHeaders headers)
-
getEncryptedContentEncryptionKey
protected byte[] getEncryptedContentEncryptionKey(JweHeaders headers, byte[] theCek)
-
getContentEncryptionAlgoJwt
protected String getContentEncryptionAlgoJwt()
-
getContentEncryptionAlgoJava
protected String getContentEncryptionAlgoJava()
-
getAAD
protected byte[] getAAD(String protectedHeaders, byte[] aad)
-
encrypt
public String encrypt(byte[] content, JweHeaders jweHeaders)
Description copied from interface:JweEncryptionProviderJWE compact encryption- Specified by:
encryptin interfaceJweEncryptionProvider
-
getEncryptionOutput
public JweEncryptionOutput getEncryptionOutput(JweEncryptionInput jweInput)
Description copied from interface:JweEncryptionProviderPrepare JWE state for completing either JWE compact or JSON encryption- Specified by:
getEncryptionOutputin interfaceJweEncryptionProvider
-
encryptInternal
protected byte[] encryptInternal(AbstractJweEncryption.JweEncryptionInternal state, byte[] content)
-
getActualCipher
protected byte[] getActualCipher(byte[] cipher)
-
getAuthenticationTag
protected byte[] getAuthenticationTag(AbstractJweEncryption.JweEncryptionInternal state, byte[] cipher)
-
getKeyAlgorithm
public KeyAlgorithm getKeyAlgorithm()
- Specified by:
getKeyAlgorithmin interfaceJweKeyProperties
-
getContentAlgorithm
public ContentAlgorithm getContentAlgorithm()
- Specified by:
getContentAlgorithmin interfaceJweKeyProperties
-
getJwtHeadersWriter
protected JsonMapObjectReaderWriter getJwtHeadersWriter()
-
getAuthenticationTagProducer
protected AuthenticationTagProducer getAuthenticationTagProducer(AbstractJweEncryption.JweEncryptionInternal state)
-
createCekSecretKey
protected SecretKey createCekSecretKey(AbstractJweEncryption.JweEncryptionInternal state)
-
getActualCek
protected byte[] getActualCek(byte[] theCek, String algoJwt)
-
getKeyEncryptionAlgo
protected KeyEncryptionProvider getKeyEncryptionAlgo()
-
-