org.apache.cxf.rs.security.jose.jwe
Class AbstractJweEncryption

java.lang.Object
  extended by org.apache.cxf.rs.security.jose.jwe.AbstractJweEncryption
All Implemented Interfaces:
JweEncryptionProvider
Direct Known Subclasses:
AesCbcHmacJweEncryption, DirectKeyJweEncryption, WrappedKeyJweEncryption

public abstract class AbstractJweEncryption
extends Object
implements JweEncryptionProvider


Nested Class Summary
protected static class AbstractJweEncryption.JweEncryptionInternal
           
 
Field Summary
protected static int DEFAULT_AUTH_TAG_LENGTH
           
 
Constructor Summary
protected AbstractJweEncryption(JweHeaders headers, ContentEncryptionAlgorithm contentEncryptionAlgo, KeyEncryptionAlgorithm keyEncryptionAlgo)
           
protected AbstractJweEncryption(JweHeaders headers, ContentEncryptionAlgorithm contentEncryptionAlgo, KeyEncryptionAlgorithm keyEncryptionAlgo, JoseHeadersWriter writer)
           
 
Method Summary
protected  SecretKey createCekSecretKey(AbstractJweEncryption.JweEncryptionInternal state)
           
 JweEncryptionState createJweEncryptionState(String contentType)
           
 String encrypt(byte[] content, String contentType)
           
protected  byte[] getAAD(JweHeaders theHeaders)
           
protected  byte[] getActualCek(byte[] theCek, String algoJwt)
           
protected  AlgorithmParameterSpec getAlgorithmParameterSpec(byte[] theIv)
           
protected  AuthenticationTagProducer getAuthenticationTagProducer(AbstractJweEncryption.JweEncryptionInternal state)
           
protected  int getCekSize(String algoJwt)
           
protected  String getContentEncryptionAlgoJava()
           
protected  String getContentEncryptionAlgoJwt()
           
protected  byte[] getContentEncryptionKey()
           
protected  byte[] getEncryptedContentEncryptionKey(byte[] theCek)
           
protected  JweCompactProducer getJweCompactProducer(AbstractJweEncryption.JweEncryptionInternal state, byte[] cipher)
           
protected  JweHeaders getJweHeaders()
           
protected  JoseHeadersWriter getJwtHeadersWriter()
           
protected  KeyEncryptionAlgorithm getKeyEncryptionAlgo()
           
protected  byte[] getProvidedContentEncryptionKey()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_AUTH_TAG_LENGTH

protected static final int DEFAULT_AUTH_TAG_LENGTH
See Also:
Constant Field Values
Constructor Detail

AbstractJweEncryption

protected AbstractJweEncryption(JweHeaders headers,
                                ContentEncryptionAlgorithm contentEncryptionAlgo,
                                KeyEncryptionAlgorithm keyEncryptionAlgo)

AbstractJweEncryption

protected AbstractJweEncryption(JweHeaders headers,
                                ContentEncryptionAlgorithm contentEncryptionAlgo,
                                KeyEncryptionAlgorithm keyEncryptionAlgo,
                                JoseHeadersWriter writer)
Method Detail

getAlgorithmParameterSpec

protected AlgorithmParameterSpec getAlgorithmParameterSpec(byte[] theIv)

getContentEncryptionKey

protected byte[] getContentEncryptionKey()

getCekSize

protected int getCekSize(String algoJwt)

getProvidedContentEncryptionKey

protected byte[] getProvidedContentEncryptionKey()

getEncryptedContentEncryptionKey

protected byte[] getEncryptedContentEncryptionKey(byte[] theCek)

getContentEncryptionAlgoJwt

protected String getContentEncryptionAlgoJwt()

getContentEncryptionAlgoJava

protected String getContentEncryptionAlgoJava()

getAAD

protected byte[] getAAD(JweHeaders theHeaders)

encrypt

public String encrypt(byte[] content,
                      String contentType)
Specified by:
encrypt in interface JweEncryptionProvider

getJweCompactProducer

protected JweCompactProducer getJweCompactProducer(AbstractJweEncryption.JweEncryptionInternal state,
                                                   byte[] cipher)

getJwtHeadersWriter

protected JoseHeadersWriter getJwtHeadersWriter()

getJweHeaders

protected JweHeaders getJweHeaders()

createJweEncryptionState

public JweEncryptionState createJweEncryptionState(String contentType)
Specified by:
createJweEncryptionState in interface JweEncryptionProvider

getAuthenticationTagProducer

protected AuthenticationTagProducer getAuthenticationTagProducer(AbstractJweEncryption.JweEncryptionInternal state)

createCekSecretKey

protected SecretKey createCekSecretKey(AbstractJweEncryption.JweEncryptionInternal state)

getActualCek

protected byte[] getActualCek(byte[] theCek,
                              String algoJwt)

getKeyEncryptionAlgo

protected KeyEncryptionAlgorithm getKeyEncryptionAlgo()


Apache CXF