com.sun.identity.wss.security.handler
Class SecureSOAPMessage

java.lang.Object
  extended bycom.sun.identity.wss.security.handler.SecureSOAPMessage

public class SecureSOAPMessage
extends java.lang.Object

This class SecureSOAPMessage constructs the secured SOAPMessage for the given security mechanism token.


Constructor Summary
SecureSOAPMessage(javax.xml.soap.SOAPMessage soapMessage, boolean create)
          Constructor to create secure SOAP message.
 
Method Summary
 java.security.cert.X509Certificate getMessageCertificate()
          Returns the X509Certificate that is used to secure the SOAPMessage.
 SecurityMechanism getSecurityMechanism()
          Returns the security mechanism of the secure soap message.
 SecurityToken getSecurityToken()
          Returns the security token associated with this secure soap message.
 javax.xml.soap.SOAPMessage getSOAPMessage()
          Returns the secured SOAP message.
 void setSecurityMechanism(SecurityMechanism securityMechanism)
          Sets the security mechanism for securing the soap message.
 void setSecurityToken(SecurityToken token)
          Sets the security token for securing the soap message.
 void sign(java.lang.String certAlias)
          Signs the SOAPMessage for the given security profile.
 boolean verifySignature()
          Verifies the signature of the SOAP message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureSOAPMessage

public SecureSOAPMessage(javax.xml.soap.SOAPMessage soapMessage,
                         boolean create)
                  throws com.sun.identity.wss.security.SecurityException
Constructor to create secure SOAP message.

Parameters:
soapMessage - the SOAP message to be secured.
create - if true, creates a new secured SOAP message by adding security headers. if false, parses the secured SOAP message.
Throws:
com.sun.identity.wss.security.SecurityException - if failed in creating or parsing the new secured SOAP message.
Method Detail

getSOAPMessage

public javax.xml.soap.SOAPMessage getSOAPMessage()
Returns the secured SOAP message.

Returns:
the secured SOAP message.

getSecurityMechanism

public SecurityMechanism getSecurityMechanism()
Returns the security mechanism of the secure soap message.

Returns:
SecurityMechanism the security mechanism of the secure SOAPMessage.

setSecurityMechanism

public void setSecurityMechanism(SecurityMechanism securityMechanism)
Sets the security mechanism for securing the soap message.

Parameters:
securityMechanism - the security mechanism that will be used to secure the soap message.

setSecurityToken

public void setSecurityToken(SecurityToken token)
                      throws com.sun.identity.wss.security.SecurityException
Sets the security token for securing the soap message.

Parameters:
token - the security token that is used to secure the soap message.
Throws:
com.sun.identity.wss.security.SecurityException - if the security token can not be added to the security header.

getSecurityToken

public SecurityToken getSecurityToken()
Returns the security token associated with this secure soap message.

Returns:
SecurityToken the security token for this secure soap message.

sign

public void sign(java.lang.String certAlias)
          throws com.sun.identity.wss.security.SecurityException
Signs the SOAPMessage for the given security profile.

Parameters:
certAlias - the certificate alias
Throws:
com.sun.identity.wss.security.SecurityException - if there is any failure in signing.

verifySignature

public boolean verifySignature()
                        throws com.sun.identity.wss.security.SecurityException
Verifies the signature of the SOAP message.

Returns:
true if the signature verification is successful.
Throws:
com.sun.identity.wss.security.SecurityException - if there is any failure in validation.

getMessageCertificate

public java.security.cert.X509Certificate getMessageCertificate()
Returns the X509Certificate that is used to secure the SOAPMessage.

Returns:
the X509 certificate.


Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.