Package com.sun.identity.wss.xmlsig
Class WSSSignatureProvider
- java.lang.Object
-
- com.sun.identity.saml.xmlsig.AMSignatureProvider
-
- com.sun.identity.wss.xmlsig.WSSSignatureProvider
-
- All Implemented Interfaces:
SignatureProvider
public class WSSSignatureProvider extends AMSignatureProvider
WSSSignatureProvideris a class for signing and signature verification of WSS XML Documents which implementsAMSignatureProvider.
-
-
Field Summary
-
Fields inherited from class com.sun.identity.saml.xmlsig.AMSignatureProvider
keystore
-
-
Constructor Summary
Constructors Constructor Description WSSSignatureProvider()Creates a new instance of WSSSignatureProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementsignWithBinarySecurityToken(Document doc, Certificate cert, String algorithm, List ids, String referenceType)Sign part of the xml document referered by the supplied a list of id attributes of nodesElementsignWithKerberosToken(Document doc, Key key, String algorithm, List ids)Sign with Kerberos TokenElementsignWithSAMLToken(Document doc, Certificate cert, String assertionID, String algorithm, List ids)Sign part of the xml document referered by the supplied a list of id attributes of nodesElementsignWithSAMLToken(Document doc, Key key, boolean symmetricKey, Certificate signingCert, Certificate encCert, String assertionID, String algorithm, List ids)Sign part of the XML document referred by the supplied a list of id attributes of nodes using SAML Token.ElementsignWithUserNameToken(Document doc, Certificate cert, String algorithm, List ids)Sign part of the xml document referered by the supplied a list of id attributes of nodesbooleanverifyWSSSignature(Document doc, String certAlias)Verify all the signatures of the WSS xml documentbooleanverifyWSSSignature(Document document, Key key)Verify web services message signature using specified keybooleanverifyWSSSignature(Document doc, Key key, String certAlias, String encryptAlias)Verify web services message signature using specified key-
Methods inherited from class com.sun.identity.saml.xmlsig.AMSignatureProvider
createDSctx, getAlgorithmURI, getCertificate, getKeyProvider, getPublicKey, getPublicKeybyDSARSAkeyValue, getX509PublicKey, initialize, isValidAlgorithm, signWithWSSSAMLTokenProfile, signWithWSSSAMLTokenProfile, signWithWSSX509TokenProfile, signWithWSSX509TokenProfile, signXML, signXML, signXML, signXML, signXML, signXML, signXML, signXML, signXML, signXML, signXML, signXML, signXML, signXMLUsingKeyPass, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature, verifyXMLSignature
-
-
-
-
Method Detail
-
signWithSAMLToken
public Element signWithSAMLToken(Document doc, Certificate cert, String assertionID, String algorithm, List ids) throws XMLSignatureException
Sign part of the xml document referered by the supplied a list of id attributes of nodes- Specified by:
signWithSAMLTokenin interfaceSignatureProvider- Overrides:
signWithSAMLTokenin classAMSignatureProvider- Parameters:
doc- XML dom objectcert- Signer's certificateassertionID- assertion IDalgorithm- XML signature algorithmids- list of id attribute values of nodes to be signed- Returns:
- SAML Security Token signature
- Throws:
XMLSignatureException- if the document could not be signed
-
signWithSAMLToken
public Element signWithSAMLToken(Document doc, Key key, boolean symmetricKey, Certificate signingCert, Certificate encCert, String assertionID, String algorithm, List ids) throws XMLSignatureException
Sign part of the XML document referred by the supplied a list of id attributes of nodes using SAML Token.- Specified by:
signWithSAMLTokenin interfaceSignatureProvider- Overrides:
signWithSAMLTokenin classAMSignatureProvider- Parameters:
doc- XML dom objectkey- the key that will be used to sign the document.symmetricKey- true if the supplied key is a symmetric key type.signingCert- signer's Certificate. If present, this certificate will be added as part of signatureKeyInfo.encCert- the certificate if present will be used to encrypt the symmetric key and replay it as part ofKeyInfoassertionID- assertion ID for the SAML Security Tokenalgorithm- XML signature algorithmids- list of id attribute values of nodes to be signed- Returns:
- SAML Security Token signature
- Throws:
XMLSignatureException- if the document could not be signed
-
signWithUserNameToken
public Element signWithUserNameToken(Document doc, Certificate cert, String algorithm, List ids) throws XMLSignatureException
Sign part of the xml document referered by the supplied a list of id attributes of nodes- Specified by:
signWithUserNameTokenin interfaceSignatureProvider- Overrides:
signWithUserNameTokenin classAMSignatureProvider- Parameters:
doc- XML dom objectcert- Signer's certificatealgorithm- XML signature algorithmids- list of id attribute values of nodes to be signed- Returns:
- X509 Security Token signature
- Throws:
XMLSignatureException- if the document could not be signed
-
signWithBinarySecurityToken
public Element signWithBinarySecurityToken(Document doc, Certificate cert, String algorithm, List ids, String referenceType) throws XMLSignatureException
Sign part of the xml document referered by the supplied a list of id attributes of nodes- Specified by:
signWithBinarySecurityTokenin interfaceSignatureProvider- Overrides:
signWithBinarySecurityTokenin classAMSignatureProvider- Parameters:
doc- XML dom objectcert- Signer's certificatealgorithm- XML signature algorithmids- list of id attribute values of nodes to be signedreferenceType- signed element reference type- Returns:
- X509 Security Token signature
- Throws:
XMLSignatureException- if the document could not be signed
-
verifyWSSSignature
public boolean verifyWSSSignature(Document doc, String certAlias) throws XMLSignatureException
Verify all the signatures of the WSS xml document- Specified by:
verifyWSSSignaturein interfaceSignatureProvider- Overrides:
verifyWSSSignaturein classAMSignatureProvider- Parameters:
doc- XML dom document whose signature to be verifiedcertAlias- certAlias alias for Signer's certificate, this is used to search signer's public certificate if it is not presented in ds:KeyInfo- Returns:
- true if the xml signature is verified, false otherwise
- Throws:
XMLSignatureException- if problem occurs during verification
-
signWithKerberosToken
public Element signWithKerberosToken(Document doc, Key key, String algorithm, List ids) throws XMLSignatureException
Sign with Kerberos Token- Specified by:
signWithKerberosTokenin interfaceSignatureProvider- Overrides:
signWithKerberosTokenin classAMSignatureProvider- Parameters:
doc-key-algorithm-ids-- Returns:
- Kerberos Security Token signature
- Throws:
XMLSignatureException
-
verifyWSSSignature
public boolean verifyWSSSignature(Document document, Key key) throws XMLSignatureException
Verify web services message signature using specified key- Specified by:
verifyWSSSignaturein interfaceSignatureProvider- Overrides:
verifyWSSSignaturein classAMSignatureProvider- Parameters:
document- the document to be validatedkey- the secret key to be used for validating signature- Returns:
- true if verification is successful.
- Throws:
XMLSignatureException
-
verifyWSSSignature
public boolean verifyWSSSignature(Document doc, Key key, String certAlias, String encryptAlias) throws XMLSignatureException
Verify web services message signature using specified key- Specified by:
verifyWSSSignaturein interfaceSignatureProvider- Overrides:
verifyWSSSignaturein classAMSignatureProvider- Parameters:
doc- the document to be validatedkey- the secret key to be used for validating signaturecertAlias- the certificate alias used for validating the signature if the key is not available.encryptAlias- the certificate alias that may be used to decrypt the symmetric key that is part ofKeyInfo- Returns:
- true if verification is successful.
- Throws:
XMLSignatureException
-
-