Class EncryptedKeyProcessor

java.lang.Object
org.apache.wss4j.dom.processor.EncryptedKeyProcessor
All Implemented Interfaces:
Processor

public class EncryptedKeyProcessor extends Object implements Processor
  • 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:
      handleToken in interface Processor
      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