Class WSSecDKSign

    • Constructor Detail

      • WSSecDKSign

        public WSSecDKSign​(WSSecHeader securityHeader)
      • WSSecDKSign

        public WSSecDKSign​(Document doc)
    • Method Detail

      • prepare

        public void prepare​(byte[] ephemeralKey)
                     throws WSSecurityException
        Description copied from class: WSSecDerivedKeyBase
        Initialize a WSSec Derived key. The method prepares and initializes a WSSec derived key structure after the relevant information was set. This method also creates and initializes the derived token using the ephemeral key. After preparation references can be added, encrypted and signed as required. This method does not add any element to the security header. This must be done explicitly.
        Overrides:
        prepare in class WSSecDerivedKeyBase
        Parameters:
        ephemeralKey - The ephemeral key to use for derivation
        Throws:
        WSSecurityException
      • getSignatureElement

        public Element getSignatureElement()
        Returns the SignatureElement. The method can be called any time after prepare().
        Returns:
        The DOM Element of the signature.
      • computeSignature

        public void computeSignature​(List<Reference> referenceList)
                              throws WSSecurityException
        Compute the Signature over the references. After references are set this method computes the Signature for them. This method can be called any time after the references were set. See addReferencesToSign().
        Throws:
        WSSecurityException
      • computeSignature

        public void computeSignature​(List<Reference> referenceList,
                                     boolean prepend,
                                     Element siblingElement)
                              throws WSSecurityException
        Compute the Signature over the references. After references are set this method computes the Signature for them. This method can be called any time after the references were set. See addReferencesToSign().
        Throws:
        WSSecurityException
      • setDerivedKeyLength

        public void setDerivedKeyLength​(int keyLength)
      • setSignatureAlgorithm

        public void setSignatureAlgorithm​(String algorithm)
        Set the signature algorithm to use. The default is WSConstants.SHA1.
        Parameters:
        algorithm - the signature algorithm to use.
      • getSignatureAlgorithm

        public String getSignatureAlgorithm()
        Returns:
        the signature algorithm to use
      • getSignatureId

        public String getSignatureId()
        Returns the the value of wsu:Id attribute of the Signature element.
        Returns:
        Return the wsu:Id of this token or null if the signature has not been generated.
      • setDigestAlgorithm

        public void setDigestAlgorithm​(String algorithm)
        Set the digest algorithm to use. The default is WSConstants.SHA1.
        Parameters:
        algorithm - the digest algorithm to use.
      • getDigestAlgorithm

        public String getDigestAlgorithm()
        Returns:
        the digest algorithm to use
      • getSignatureValue

        public byte[] getSignatureValue()
        Returns:
        Returns the signatureValue.
      • getSigCanonicalization

        public String getSigCanonicalization()
        Get the canonicalization method. If the canonicalization method was not set then Exclusive XML Canonicalization is used by default.
        Returns:
        The string describing the canonicalization algorithm.
      • isAddInclusivePrefixes

        public boolean isAddInclusivePrefixes()
      • setAddInclusivePrefixes

        public void setAddInclusivePrefixes​(boolean addInclusivePrefixes)