public class SecureSOAPMessage extends Object
SecureSOAPMessage
constructs the secured
SOAPMessage
for the given security mechanism token.Constructor and Description |
---|
SecureSOAPMessage(SOAPMessage soapMessage,
boolean create)
Constructor to create secure SOAP message.
|
SecureSOAPMessage(SOAPMessage soapMessage,
boolean create,
List signedElements)
Constructor to create secure SOAP message.
|
Modifier and Type | Method and Description |
---|---|
void |
decrypt(String keyAlias,
boolean decryptBody,
boolean decryptHeader)
Decrypts the
SOAPMessage for the given security profile. |
void |
encrypt(String certAlias,
String encryptionAlgorithm,
int encryptionKeyStrength,
boolean encryptBody,
boolean encryptHeader)
Encrypts the
SOAPMessage for the given security profile. |
String |
getClientDnsClaim() |
X509Certificate |
getMessageCertificate()
Returns the
X509Certificate that is used to secure
the SOAPMessage . |
String |
getMessageID()
Returns the messageID from the
|
long |
getMessageTimestamp()
Retruns the message timestamp.
|
SecurityContext |
getSecurityContext() |
Element |
getSecurityHeaderElement()
Returns the Security Header Element.
|
SecurityMechanism |
getSecurityMechanism()
Returns the security mechanism of the secure soap message.
|
SecurityToken |
getSecurityToken()
Returns the security token associated with this secure soap message.
|
SOAPMessage |
getSOAPMessage()
Returns the secured SOAP message.
|
void |
parseSecurityHeader(Node node)
Parses for the security header.
|
void |
setSecurityContext(SecurityContext securityContext) |
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 |
setSenderIdentity(String dnsName) |
void |
setSignedElements(List elements) |
void |
setSOAPMessage(SOAPMessage inSoapMessage)
Sets the secured SOAP message.
|
void |
sign()
Signs the
SOAPMessage for the given security profile. |
boolean |
verifyKerberosTokenSignature(Key secretKey)
Verifies the signature of the SOAP message that has kerberos key.
|
boolean |
verifySignature()
Verifies the signature of the SOAP message.
|
public SecureSOAPMessage(SOAPMessage soapMessage, boolean create) throws SecurityException
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.SecurityException
- if failed in creating or parsing the
new secured SOAP message.public SecureSOAPMessage(SOAPMessage soapMessage, boolean create, List signedElements) throws SecurityException
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.signedElements
- list of signed elementsSecurityException
- if failed in creating or parsing the
new secured SOAP message.public Element getSecurityHeaderElement()
public SOAPMessage getSOAPMessage()
public void setSOAPMessage(SOAPMessage inSoapMessage)
inSoapMessage
- the input secured SOAP message.public void parseSecurityHeader(Node node) throws SecurityException
node
- security header node.SecurityException
- if there is any error occured.public SecurityMechanism getSecurityMechanism()
SOAPMessage
.public void setSecurityMechanism(SecurityMechanism securityMechanism)
securityMechanism
- the security mechanism that will be used
to secure the soap message.public void setSecurityToken(SecurityToken token) throws SecurityException
token
- the security token that is used to secure the soap message.SecurityException
- if the security token can not be added
to the security header.public SecurityToken getSecurityToken()
public SecurityContext getSecurityContext()
public void setSecurityContext(SecurityContext securityContext)
public void sign() throws SecurityException
SOAPMessage
for the given security profile.SecurityException
- if there is any failure in signing.public String getMessageID()
public long getMessageTimestamp()
public boolean verifySignature() throws SecurityException
SecurityException
- if there is any failure in validation.public boolean verifyKerberosTokenSignature(Key secretKey) throws SecurityException
secretKey
- the secret key that is used for signature verification.SecurityException
- if there is any failure in validation.public X509Certificate getMessageCertificate()
X509Certificate
that is used to secure
the SOAPMessage
.public void encrypt(String certAlias, String encryptionAlgorithm, int encryptionKeyStrength, boolean encryptBody, boolean encryptHeader) throws SecurityException
SOAPMessage
for the given security profile.certAlias
- the certificate aliasencryptBody
- boolean flag to encrypt BodyencryptHeader
- boolean flag to encrypt Security headerSecurityException
- if there is any failure in encryption.public void decrypt(String keyAlias, boolean decryptBody, boolean decryptHeader) throws SecurityException
SOAPMessage
for the given security profile.keyAlias
- private key alias that is used to decrypt.decryptBody
- boolean flag to decrypt BodydecryptHeader
- boolean flag to decrypt Security headerSecurityException
- if there is any failure in decryption.public void setSenderIdentity(String dnsName)
public String getClientDnsClaim()
public void setSignedElements(List elements)
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.