Class WSSignEnvelope


  • public class WSSignEnvelope
    extends WSBaseMessage
    Signs a SOAP envelope according to WS Specification, X509 profile, and adds the signature data.
    Author:
    Davanum Srinivas (dims@yahoo.com), Werner Dittmann (Werner.Dittman@siemens.com)
    • Field Detail

      • useSingleCert

        protected boolean useSingleCert
      • sigAlgo

        protected java.lang.String sigAlgo
      • canonAlgo

        protected java.lang.String canonAlgo
      • signatureValue

        protected byte[] signatureValue
    • Constructor Detail

      • WSSignEnvelope

        public WSSignEnvelope()
        Deprecated.
        replaced by WSSecSignature()
        Constructor.
      • WSSignEnvelope

        public WSSignEnvelope​(java.lang.String actor)
        Deprecated.
        replaced by WSSecSignature() and WSSecHeader for actor specification.
        Constructor.
        Parameters:
        actor - The actor name of the wsse:Security header
      • WSSignEnvelope

        public WSSignEnvelope​(java.lang.String actor,
                              boolean mu)
        Deprecated.
        replaced by WSSecSignature() and WSSecHeader for actor and mustunderstand specification.
        Constructor.
        Parameters:
        actor - The actor name of the wsse:Security header
        mu - Set mustUnderstand to true or false
    • Method Detail

      • setSignatureAlgorithm

        public void setSignatureAlgorithm​(java.lang.String algo)
        Set the name of the signature encryption algorithm to use. If the algorithm is not set then Triple RSA is used. Refer to WSConstants which algorithms are supported.
        Parameters:
        algo - Is the name of the signature algorithm
        See Also:
        WSConstants.RSA, WSConstants.DSA
      • getSignatureAlgorithm

        public java.lang.String getSignatureAlgorithm()
        Get the name of the signature algorithm that is being used. If the algorithm is not set then RSA is default.
        Returns:
        the identifier URI of the signature algorithm
      • getSigCanonicalization

        public java.lang.String getSigCanonicalization()
        Get the canonicalization method. If the canonicalization method was not set then Exclusive XML Canonicalization is used by default.
        Returns:
        TODO
      • build

        public org.w3c.dom.Document build​(org.w3c.dom.Document doc,
                                          Crypto crypto)
                                   throws WSSecurityException
        Builds a signed soap envelope. The method first gets an appropriate security header. According to the defined parameters for certificate handling the signature elements are constructed and inserted into the wsse:Signature
        Parameters:
        doc - The unsigned SOAP envelope as Document
        crypto - An instance of the Crypto API to handle keystore and certificates
        Returns:
        A signed SOAP envelope as Document
        Throws:
        WSSecurityException
      • createSTRParameter

        protected org.w3c.dom.Element createSTRParameter​(org.w3c.dom.Document doc)
      • getInclusivePrefixes

        protected java.util.Set getInclusivePrefixes​(org.w3c.dom.Element target)
      • getInclusivePrefixes

        protected java.util.Set getInclusivePrefixes​(org.w3c.dom.Element target,
                                                     boolean excludeVisible)