org.apache.ws.security.saml
Class WSSecSignatureSAML
java.lang.Object
org.apache.ws.security.message.WSSecBase
org.apache.ws.security.message.WSSecSignature
org.apache.ws.security.saml.WSSecSignatureSAML
- public class WSSecSignatureSAML
- extends WSSecSignature
Fields inherited from class org.apache.ws.security.message.WSSecSignature |
bstToken, canonAlgo, certUri, document, keyInfo, keyInfoUri, secRef, sig, sigAlgo, signatureValue, strUri, usernameToken, useSingleCert, wsDocInfo |
Method Summary |
void |
addReferencesToSign(java.util.Vector references,
WSSecHeader secHeader)
This method adds references to the Signature. |
org.w3c.dom.Document |
build(org.w3c.dom.Document doc,
Crypto uCrypto,
org.opensaml.SAMLAssertion assertion,
Crypto iCrypto,
java.lang.String iKeyName,
java.lang.String iKeyPW,
WSSecHeader secHeader)
Builds a signed soap envelope with SAML token. |
void |
computeSignature()
Compute the Signature over the references. |
void |
prepare(org.w3c.dom.Document doc,
Crypto uCrypto,
org.opensaml.SAMLAssertion assertion,
Crypto iCrypto,
java.lang.String iKeyName,
java.lang.String iKeyPW,
WSSecHeader secHeader)
Initialize a WSSec SAML Signature. |
void |
prependSAMLElementsToHeader(WSSecHeader secHeader)
Prepend the SAML elements to the elements already in the Security header. |
Methods inherited from class org.apache.ws.security.message.WSSecSignature |
build, createSTRParameter, getId, getInclusivePrefixes, getInclusivePrefixes, getSigCanonicalization, getSignatureAlgorithm, getSignatureValue, isUseSingleCertificate, prepare, prependBSTElementToHeader, prependToHeader, setSigCanonicalization, setSignatureAlgorithm, setUsernameToken, setUseSingleCertificate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WSSecSignatureSAML
public WSSecSignatureSAML()
- Constructor.
build
public org.w3c.dom.Document build(org.w3c.dom.Document doc,
Crypto uCrypto,
org.opensaml.SAMLAssertion assertion,
Crypto iCrypto,
java.lang.String iKeyName,
java.lang.String iKeyPW,
WSSecHeader secHeader)
throws WSSecurityException
- Builds a signed soap envelope with SAML token.
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
assertion
- the complete SAML assertion
- Returns:
- A signed SOAP envelope as
Document
- Throws:
WSSecurityException
prepare
public void prepare(org.w3c.dom.Document doc,
Crypto uCrypto,
org.opensaml.SAMLAssertion assertion,
Crypto iCrypto,
java.lang.String iKeyName,
java.lang.String iKeyPW,
WSSecHeader secHeader)
throws WSSecurityException
- Initialize a WSSec SAML Signature.
The method sets up and initializes a WSSec SAML Signature structure after
the relevant information was set. After setup of the references to
elements to sign may be added. After all references are added they can be
signed.
This method does not add the Signature element to the security header.
See
prependSignatureElementToHeader()
method.
- Parameters:
doc
- The SOAP envelope as Document
secHeader
- The security header that will hold the Signature. This ise use
to construct namespace prefixes for Signature. This method
- Throws:
WSSecurityException
prependSAMLElementsToHeader
public void prependSAMLElementsToHeader(WSSecHeader secHeader)
- Prepend the SAML elements to the elements already in the Security header.
The method can be called any time after
prepare()
. This
allows to insert the SAML elements at any position in the Security
header.
This methods first prepends the SAML security reference if mode is
senderVouches
, then the SAML token itself,
- Parameters:
secHeader
- The security header that holds the BST element.
addReferencesToSign
public void addReferencesToSign(java.util.Vector references,
WSSecHeader secHeader)
throws WSSecurityException
- This method adds references to the Signature.
The added references are signed when calling
computeSignature()
. This method can be called several
times to add references as required. addReferencesToSign()
can be called anytime after prepare
.
- Overrides:
addReferencesToSign
in class WSSecSignature
- Parameters:
references
- A vector containing WSEncryptionPart
objects
that define the parts to sign.secHeader
- Used to compute namespaces to be inserted by
InclusiveNamespaces to be WSI compliant.
- Throws:
WSSecurityException
computeSignature
public void computeSignature()
throws WSSecurityException
- Compute the Signature over the references.
After references are set this method computes the Signature for them.
This method can be called anytime after the references were set. See
addReferencesToSign()
.
- Overrides:
computeSignature
in class WSSecSignature
- Throws:
WSSecurityException
Copyright © 2004-2008 Apache Web Services. All Rights Reserved.