com.ibm.websphere.wssecurity.wssapi.signature

Interface WSSSignature



  • public interface WSSSignature
    This interface is responsible for the signature component. The following values are the default values for WSSSignature interface:
    • target of signature
      • BODY, ADDRESSING_HEADERS, TIMESTAMP
    • signature method
      • RSA_SHA1
    • canonicalization method
      • EXC_C14N
    This instace is generated by using a the security token. Following is the sample code to configure the signature. The sample code of generating the callbackhandler is shown in the X509Token.
        WSSFactory factory = WSSFactory.getInstance();
        WSSGenerationContext gencont = factory.newWSSGenerationContext();
    
        X509GenerateCallbackHandler callbackhandler = generateCallbackHandler();
        SecurityToken token = factory.newSecurityToken(X509Token.class, callbackHandler);
        WSSSignature sig = factory.newWSSSignature(token);
    
        gencont.add(sig);
     
    See Also:
    WSSSignPart
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int ADDRESSING_HEADERS
      The keyword for the WS-Addressing headers that are defined by the Web Services Addressing(WS-Addressing) specification.
      static int BODY
      The keyword for the SOAP body.
      static java.lang.String C14N
      The URI for the inclusive canonicalization algorithm, C14n: http://www.w3.org/2001/10/xml-c14n#.
      static java.lang.String EXC_C14N
      The URI for the exclusive canonicalization algorithm, Exc-C14n: http://www.w3.org/2001/10/xml-exc-c14n#.
      static java.lang.String HMAC_SHA1
      The URI for the signature algorithm, HMAC_SHA1: http://www.w3.org/2000/09/xmldsig#hmac-sha1.
      static java.lang.String RSA_SHA1
      The URI for the signature algorithm, RSA_SHA1: http://www.w3.org/2000/09/xmldsig#rsa-sha1.
      static int TIMESTAMP
      The keyword for the creation and expiration time stamp information.
    • Field Detail

      • TIMESTAMP

        static final int TIMESTAMP
        The keyword for the creation and expiration time stamp information.
        See Also:
        Constant Field Values
      • RSA_SHA1

        static final java.lang.String RSA_SHA1
        The URI for the signature algorithm, RSA_SHA1: http://www.w3.org/2000/09/xmldsig#rsa-sha1.
        See Also:
        Constant Field Values
      • HMAC_SHA1

        static final java.lang.String HMAC_SHA1
        The URI for the signature algorithm, HMAC_SHA1: http://www.w3.org/2000/09/xmldsig#hmac-sha1.
        See Also:
        Constant Field Values
      • EXC_C14N

        static final java.lang.String EXC_C14N
        The URI for the exclusive canonicalization algorithm, Exc-C14n: http://www.w3.org/2001/10/xml-exc-c14n#.
        See Also:
        Constant Field Values
      • C14N

        static final java.lang.String C14N
        The URI for the inclusive canonicalization algorithm, C14n: http://www.w3.org/2001/10/xml-c14n#.
        See Also:
        Constant Field Values
    • Method Detail

      • addSignPart

        void addSignPart(WSSSignPart part)
        Adds the WSSSignaturePart object as a signature part.
        Parameters:
        part - signature part
      • addSignPart

        void addSignPart(SecurityToken securityToken)
        Adds the SecurityToken object as a signature part.
        Parameters:
        securityToken - signature part
      • addSignPart

        void addSignPart(WSSTimestamp timestamp)
        Adds the WSSTimestamp object as a signature part.
        Parameters:
        timestamp - signature part.
      • addSignPartByXPath

        void addSignPartByXPath(java.lang.String xpath)
        Adds an XPath expression as a signature part.
        Parameters:
        xpath - XPath expression of a signature part
      • addSignHeader

        void addSignHeader(javax.xml.namespace.QName header)
        Adds the header in the SOAP Header, specified by QName, as a signature part.
        Parameters:
        header - signature part
      • setSignatureMethod

        void setSignatureMethod(java.lang.String algorithm)
                                throws WSSException
        Sets the signature method.
        Parameters:
        algorithm - signature algorithm
        Throws:
        WSSException - the algorithm is not supported
      • setCanonicalizationMethod

        void setCanonicalizationMethod(java.lang.String algorithm)
                                       throws WSSException
        Sets the canonicalization method.
        Parameters:
        algorithm - canonicalization method
        Throws:
        WSSException - the algorithm is not supported
      • requireSignatureConfirmation

        void requireSignatureConfirmation()
        Stores the its value of the signature confirmation in order to validate the signature confirmation after the receiving the message with it. This method is called if the response message is expected to attach the signature confirmation into. The signature confirmation is defined in the OASIS WS-Security Version 1.1 Specification.
IBM WebSphere Application ServerTM
Release 9.0