IBM WebSphere Application ServerTM
Release 8

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:

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
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.
 
Method Summary
 void addSignHeader(javax.xml.namespace.QName header)
          Adds the header in the SOAP Header, specified by QName, as a signature part.
 void addSignPart(int keyword)
          Adds the keyword for the signature part: BODY, ADDRESSING_HEADERS, or TIMESTAMP.
 void addSignPart(SecurityToken securityToken)
          Adds the SecurityToken object as a signature part.
 void addSignPart(WSSSignPart part)
          Adds the WSSSignaturePart object as a signature part.
 void addSignPart(WSSTimestamp timestamp)
          Adds the WSSTimestamp object as a signature part.
 void addSignPartByXPath(java.lang.String xpath)
          Adds an XPath expression as a signature part.
 void requireSignatureConfirmation()
          Stores the its value of the signature confirmation in order to validate the signature confirmation after the receiving the message with it.
 void setCanonicalizationMethod(java.lang.String algorithm)
          Sets the canonicalization method.
 void setSignatureMethod(java.lang.String algorithm)
          Sets the signature method.
 void setTokenReference(int refType)
          Sets the type of token reference. such as
 

Field Detail

BODY

static final int BODY
The keyword for the SOAP body.

See Also:
Constant Field Values

ADDRESSING_HEADERS

static final int ADDRESSING_HEADERS
The keyword for the WS-Addressing headers that are defined by the Web Services Addressing(WS-Addressing) specification.

See Also:
Constant Field Values

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(int keyword)
                 throws WSSException
Adds the keyword for the signature part: BODY, ADDRESSING_HEADERS, or TIMESTAMP.

Parameters:
keyword - signature part
Throws:
WSSException - if the part is not valid.

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

setTokenReference

void setTokenReference(int refType)
                       throws WSSException
Sets the type of token reference. such as SecurityToken.REF_STR, SecurityToken.REF_KEYID, SecurityToken.REF_EMBEDDED ,or SecurityToken.REF_THUMBPRINT.

Parameters:
refType - type of token reference
Throws:
WSSException - if the reference type is not valid.

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 8