org.apache.ws.security.processor
Class ReferenceListProcessor

java.lang.Object
  extended by org.apache.ws.security.processor.ReferenceListProcessor
All Implemented Interfaces:
Processor

public class ReferenceListProcessor
extends Object
implements Processor


Constructor Summary
ReferenceListProcessor()
           
 
Method Summary
static WSDataRef decryptEncryptedData(org.w3c.dom.Document doc, String dataRefURI, org.w3c.dom.Element encData, javax.crypto.SecretKey symmetricKey, String symEncAlgo)
          Decrypt the EncryptedData argument using a SecretKey.
static org.w3c.dom.Element findEncryptedDataElement(org.w3c.dom.Document doc, String dataRefURI)
          Look up the encrypted data.
 String getId()
          Get the Id of the processor.
static String getXPath(org.w3c.dom.Node decryptedNode)
           
 void handleToken(org.w3c.dom.Element elem, Crypto crypto, Crypto decCrypto, javax.security.auth.callback.CallbackHandler cb, WSDocInfo wdi, Vector returnResults, WSSConfig wsc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceListProcessor

public ReferenceListProcessor()
Method Detail

handleToken

public void handleToken(org.w3c.dom.Element elem,
                        Crypto crypto,
                        Crypto decCrypto,
                        javax.security.auth.callback.CallbackHandler cb,
                        WSDocInfo wdi,
                        Vector returnResults,
                        WSSConfig wsc)
                 throws WSSecurityException
Specified by:
handleToken in interface Processor
Throws:
WSSecurityException

findEncryptedDataElement

public static org.w3c.dom.Element findEncryptedDataElement(org.w3c.dom.Document doc,
                                                           String dataRefURI)
                                                    throws WSSecurityException
Look up the encrypted data. First try wsu:Id="someURI". If no such Id then try the generic lookup to find Id="someURI"

Parameters:
doc - The document in which to find EncryptedData
dataRefURI - The URI of EncryptedData
Returns:
The EncryptedData element
Throws:
WSSecurityException - if the EncryptedData element referenced by dataRefURI is not found

decryptEncryptedData

public static WSDataRef decryptEncryptedData(org.w3c.dom.Document doc,
                                             String dataRefURI,
                                             org.w3c.dom.Element encData,
                                             javax.crypto.SecretKey symmetricKey,
                                             String symEncAlgo)
                                      throws WSSecurityException
Decrypt the EncryptedData argument using a SecretKey.

Parameters:
doc - The (document) owner of EncryptedData
dataRefURI - The URI of EncryptedData
encData - The EncryptedData element
symmetricKey - The SecretKey with which to decrypt EncryptedData
symEncAlgo - The symmetric encryption algorithm to use
Throws:
WSSecurityException

getId

public String getId()
Description copied from interface: Processor
Get the Id of the processor.

Specified by:
getId in interface Processor
Returns:
The Id string

getXPath

public static String getXPath(org.w3c.dom.Node decryptedNode)
Parameters:
decryptedNode - the decrypted node
Returns:
a fully built xpath (eg. "/soapenv:Envelope/soapenv:Body/ns:decryptedElement") if the decryptedNode is an Element or an Attr node and is not detached from the document. null otherwise


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.