Package org.apache.wss4j.dom.processor
Class EncryptedKeyProcessor
java.lang.Object
org.apache.wss4j.dom.processor.EncryptedKeyProcessor
- All Implemented Interfaces:
Processor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected WSDataRefdecryptDataRef(Document doc, String dataRefURI, WSDocInfo docInfo, byte[] decryptedData, RequestData data) Decrypt an EncryptedData element referenced by dataRefURIdecryptDataRefs(Element refList, WSDocInfo docInfo, byte[] decryptedBytes, RequestData data) Decrypt all data referencesprotected byte[]getAsymmetricDecryptedBytes(RequestData data, WSDocInfo wsDocInfo, String encryptedKeyTransportMethod, byte[] encryptedEphemeralKey, Element refList, Element encryptedKeyElement, PrivateKey privateKey) Initializes the cipher decrypting the encryptedEphemeralKey as indicated by the encryptedKeyTransportMethodprotected static byte[]getRandomKey(String algorithmURI) Generate a random secret key of exactly the length required by the given algorithm.protected static byte[]getRandomKey(Element refList, WSDocInfo wsDocInfo) Generates a random secret key using the algorithm specified in the first DataReference URIhandleToken(Element elem, RequestData data) handleToken(Element elem, RequestData data, org.apache.wss4j.common.crypto.AlgorithmSuite algorithmSuite)
-
Constructor Details
-
EncryptedKeyProcessor
public EncryptedKeyProcessor()
-
-
Method Details
-
handleToken
public List<WSSecurityEngineResult> handleToken(Element elem, RequestData data) throws org.apache.wss4j.common.ext.WSSecurityException - Specified by:
handleTokenin interfaceProcessor- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
handleToken
public List<WSSecurityEngineResult> handleToken(Element elem, RequestData data, org.apache.wss4j.common.crypto.AlgorithmSuite algorithmSuite) throws org.apache.wss4j.common.ext.WSSecurityException - Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
getAsymmetricDecryptedBytes
protected byte[] getAsymmetricDecryptedBytes(RequestData data, WSDocInfo wsDocInfo, String encryptedKeyTransportMethod, byte[] encryptedEphemeralKey, Element refList, Element encryptedKeyElement, PrivateKey privateKey) throws org.apache.wss4j.common.ext.WSSecurityException Initializes the cipher decrypting the encryptedEphemeralKey as indicated by the encryptedKeyTransportMethod- Parameters:
data-wsDocInfo-encryptedKeyTransportMethod-encryptedEphemeralKey-refList-encryptedKeyElement-privateKey-- Returns:
- the decrypted key or, in case of an exception during the decryption, a randomKey
- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
getRandomKey
protected static byte[] getRandomKey(Element refList, WSDocInfo wsDocInfo) throws org.apache.wss4j.common.ext.WSSecurityException Generates a random secret key using the algorithm specified in the first DataReference URI- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
getRandomKey
protected static byte[] getRandomKey(String algorithmURI) throws org.apache.wss4j.common.ext.WSSecurityException Generate a random secret key of exactly the length required by the given algorithm.- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
decryptDataRefs
protected List<WSDataRef> decryptDataRefs(Element refList, WSDocInfo docInfo, byte[] decryptedBytes, RequestData data) throws org.apache.wss4j.common.ext.WSSecurityException Decrypt all data references- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
decryptDataRef
protected WSDataRef decryptDataRef(Document doc, String dataRefURI, WSDocInfo docInfo, byte[] decryptedData, RequestData data) throws org.apache.wss4j.common.ext.WSSecurityException Decrypt an EncryptedData element referenced by dataRefURI- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-