Class WSSecDKEncrypt


  • public class WSSecDKEncrypt
    extends WSSecDerivedKeyBase
    Encrypts and signes parts of a message with derived keys derived from a symmetric key. This symmetric key will be included as an EncryptedKey
    Author:
    Ruchith Fernando (ruchith.fernando@gmail.com)
    • Field Detail

      • symEncAlgo

        protected java.lang.String symEncAlgo
    • Constructor Detail

      • WSSecDKEncrypt

        public WSSecDKEncrypt()
    • Method Detail

      • build

        public org.w3c.dom.Document build​(org.w3c.dom.Document doc,
                                          WSSecHeader secHeader)
                                   throws WSSecurityException,
                                          org.apache.ws.security.conversation.ConversationException
        Throws:
        WSSecurityException
        org.apache.ws.security.conversation.ConversationException
      • encryptForExternalRef

        public org.w3c.dom.Element encryptForExternalRef​(org.w3c.dom.Element dataRef,
                                                         java.util.Vector references)
                                                  throws WSSecurityException
        Encrypt one or more parts or elements of the message (external). This method takes a vector of WSEncryptionPart object that contain information about the elements to encrypt. The method call the encryption method, takes the reference information generated during encryption and add this to the xenc:Reference element. This method can be called after prepare() and can be called multiple times to encrypt a number of parts or elements.

        The method generates a xenc:Reference element that must be added to the SecurityHeader. See addExternalRefElement().

        If the dataRef parameter is null the method creates and initializes a new Reference element.
        Parameters:
        dataRef - A xenc:Reference element or null
        references - A vector containing WSEncryptionPart objects
        Returns:
        Returns the updated xenc:Reference element
        Throws:
        WSSecurityException
      • addExternalRefElement

        public void addExternalRefElement​(org.w3c.dom.Element referenceList,
                                          WSSecHeader secHeader)
        Adds (prepends) the external Reference element to the Security header. The reference element must be created by the encryptForExternalRef() method. The method adds the reference element in the SecurityHeader.
        Parameters:
        dataRef - The external enc:Reference element
        secHeader - The security header.
      • createDataRefList

        public static org.w3c.dom.Element createDataRefList​(org.w3c.dom.Document doc,
                                                            org.w3c.dom.Element referenceList,
                                                            java.util.Vector encDataRefs)
      • setSymmetricEncAlgorithm

        public void setSymmetricEncAlgorithm​(java.lang.String algo)