|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.identity.saml.xmlsig.XMLSignatureManager
The class XMLSignatureManager
provides methods
to sign and verify XML signature.
Method Summary | |
static XMLSignatureManager |
getInstance()
Gets the singleton instance of XMLSignatureManager with
default KeyProvider and SignatureProvider . |
static XMLSignatureManager |
getInstance(KeyProvider keyProvider,
SignatureProvider sigProvider)
Get an instance of XMLSignatureManager with specified
KeyProvider and SignatureProvider . |
KeyProvider |
getKeyProvider()
Get KeyProvider |
org.w3c.dom.Element |
signWithBinarySecurityToken(org.w3c.dom.Document doc,
java.security.cert.Certificate cert,
java.lang.String algorithm,
java.util.List ids)
Sign part of the XML document wth binary security token using referred by the supplied a list of id attributes of nodes. |
org.w3c.dom.Element |
signWithSAMLToken(org.w3c.dom.Document doc,
java.security.cert.Certificate cert,
java.lang.String assertionID,
java.lang.String algorithm,
java.util.List ids)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
org.w3c.dom.Element |
signWithWSSSAMLTokenProfile(org.w3c.dom.Document doc,
java.security.cert.Certificate cert,
java.lang.String assertionID,
java.lang.String algorithm,
java.util.List ids)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
org.w3c.dom.Element |
signWithWSSSAMLTokenProfile(org.w3c.dom.Document doc,
java.security.cert.Certificate cert,
java.lang.String assertionID,
java.lang.String algorithm,
java.util.List ids,
java.lang.String wsfVersion)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
org.w3c.dom.Element |
signWithWSSX509TokenProfile(org.w3c.dom.Document doc,
java.security.cert.Certificate cert,
java.lang.String algorithm,
java.util.List ids)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
org.w3c.dom.Element |
signWithWSSX509TokenProfile(org.w3c.dom.Document doc,
java.security.cert.Certificate cert,
java.lang.String algorithm,
java.util.List ids,
java.lang.String wsfVersion)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias)
Sign the XML document using enveloped signatures. |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias,
java.lang.String algorithm)
Sign the XML document using enveloped signatures. |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias,
java.lang.String algorithm,
java.util.List ids)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias,
java.lang.String algorithm,
java.lang.String id)
Sign part of the XML document referred by the supplied id attribute using enveloped signatures and use exclusive XML canonicalization. |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias,
java.lang.String algorithm,
java.lang.String transformAlag,
java.util.List ids)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias,
java.lang.String algorithm,
java.lang.String id,
java.lang.String xpath)
Sign part of the XML document referred by the supplied id attribute using enveloped signatures and use exclusive XML canonicalization. |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias,
java.lang.String algorithm,
java.lang.String idAttrName,
java.lang.String id,
boolean includeCert)
Sign part of the XML document referred by the supplied id attribute using enveloped signatures and use exclusive XML canonicalization. |
org.w3c.dom.Element |
signXML(org.w3c.dom.Document doc,
java.lang.String certAlias,
java.lang.String algorithm,
java.lang.String idAttrName,
java.lang.String id,
boolean includeCert,
java.lang.String xpath)
Sign part of the XML document referred by the supplied id attribute using enveloped signatures and use exclusive XML canonicalization. |
java.lang.String |
signXML(java.lang.String XML,
java.lang.String certAlias)
Sign the XML string using enveloped signatures. |
java.lang.String |
signXML(java.lang.String XML,
java.lang.String certAlias,
java.lang.String algorithm)
Sign the XML string using enveloped signatures. |
java.lang.String |
signXML(java.lang.String xmlString,
java.lang.String certAlias,
java.lang.String algorithm,
java.util.List ids)
Sign part of the XML document referred by the supplied a list of id attributes of nodes |
java.lang.String |
signXML(java.lang.String xmlString,
java.lang.String certAlias,
java.lang.String algorithm,
java.lang.String id)
Sign the XML string using enveloped signatures. |
java.lang.String |
signXML(java.lang.String xmlString,
java.lang.String certAlias,
java.lang.String algorithm,
java.lang.String idAttrName,
java.lang.String id,
boolean includeCert)
Sign part of the XML document referred by the supplied id attribute using enveloped signatures and use exclusive XML canonicalization. |
boolean |
verifyWSSSignature(org.w3c.dom.Document document,
java.lang.String certAlias)
Verify all the signatures of the XML document for the web services security. |
boolean |
verifyXMLSignature(org.w3c.dom.Document document)
Verify all the signatures of the XML document |
boolean |
verifyXMLSignature(org.w3c.dom.Document document,
java.security.cert.Certificate cert)
Verify the signature of the XML document |
boolean |
verifyXMLSignature(org.w3c.dom.Document document,
java.lang.String certAlias)
Verify all the signatures of the XML document |
boolean |
verifyXMLSignature(org.w3c.dom.Element element)
Verify the signature of the XML document |
boolean |
verifyXMLSignature(org.w3c.dom.Element element,
java.lang.String certAlias)
Verify the signature of the XML document |
boolean |
verifyXMLSignature(org.w3c.dom.Element element,
java.lang.String idAttrName,
java.lang.String certAlias)
Verify the signature of the XML document |
boolean |
verifyXMLSignature(java.lang.String XML)
Verify the signature of the XML string |
boolean |
verifyXMLSignature(java.lang.String XML,
java.lang.String certAlias)
Verify the signature of the XML string |
boolean |
verifyXMLSignature(java.lang.String wsfVersion,
java.lang.String certAlias,
org.w3c.dom.Document document)
Verify all the signatures of the XML document |
boolean |
verifyXMLSignature(java.lang.String xmlString,
java.lang.String idAttrName,
java.lang.String certAlias)
Verify the signature of the XML string |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static XMLSignatureManager getInstance()
XMLSignatureManager
with
default KeyProvider
and SignatureProvider
.
XMLSignatureManager
public static XMLSignatureManager getInstance(KeyProvider keyProvider, SignatureProvider sigProvider)
XMLSignatureManager
with specified
KeyProvider
and SignatureProvider
.
keyProvider
- KeyProvider
sigProvider
- SignatureProvider
.
XMLSignatureManager
.public org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias name
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias, java.lang.String algorithm) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- signature algorithm
XMLSignatureException
- if the document could not be signedpublic java.lang.String signXML(java.lang.String XML, java.lang.String certAlias) throws XMLSignatureException
XML
- XML string to be signedcertAlias
- Signer's certificate alias name
XMLSignatureException
- if the XML string could not be signedpublic java.lang.String signXML(java.lang.String XML, java.lang.String certAlias, java.lang.String algorithm) throws XMLSignatureException
XML
- XML string to be signedcertAlias
- Signer's certificate alias namealgorithm
- signature algorithm
XMLSignatureException
- if the XML string could not be signedpublic org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias, java.lang.String algorithm, java.lang.String id) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmid
- attribute value of the node to be signed
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias, java.lang.String algorithm, java.lang.String id, java.lang.String xpath) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmid
- id attribute value of the node to be signedxpath
- expression should uniquely identify a node before which
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias, java.lang.String algorithm, java.lang.String idAttrName, java.lang.String id, boolean includeCert) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmidAttrName
- attribute name for the id attribute of the node to be
signed.id
- id attribute value of the node to be signedincludeCert
- if true, include the signing certificate in
KeyInfo
. if false, does not include the signing
certificate.
XMLSignatureException
- if the document could not be signedpublic java.lang.String signXML(java.lang.String xmlString, java.lang.String certAlias, java.lang.String algorithm, java.lang.String idAttrName, java.lang.String id, boolean includeCert) throws XMLSignatureException
xmlString
- a string representing XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmidAttrName
- attribute name for the id attribute of the node to be
signed.id
- id attribute value of the node to be signedincludeCert
- if true, include the signing certificate in
KeyInfo
.
if false, does not include the signing certificate.
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias, java.lang.String algorithm, java.lang.String idAttrName, java.lang.String id, boolean includeCert, java.lang.String xpath) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmidAttrName
- attribute name for the id attribute of the node to be
signed.id
- id attribute value of the node to be signedincludeCert
- if true, include the signing certificate in
KeyInfo
.
if false, does not include the signing certificate.xpath
- expression should uniquely identify a node before which
XMLSignatureException
- if the document could not be signedpublic java.lang.String signXML(java.lang.String xmlString, java.lang.String certAlias, java.lang.String algorithm, java.lang.String id) throws XMLSignatureException
xmlString
- XML string to be signedcertAlias
- Signer's certificate alias namealgorithm
- XML Signature algorithmid
- id attribute value of the node to be signed
XMLSignatureException
- if the XML string could not be signedpublic org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias, java.lang.String algorithm, java.util.List ids) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signed
XMLSignatureException
- if the document could not be signedpublic java.lang.String signXML(java.lang.String xmlString, java.lang.String certAlias, java.lang.String algorithm, java.util.List ids) throws XMLSignatureException
xmlString
- XML dom object's string formatcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signed
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signXML(org.w3c.dom.Document doc, java.lang.String certAlias, java.lang.String algorithm, java.lang.String transformAlag, java.util.List ids) throws XMLSignatureException
doc
- XML dom objectcertAlias
- Signer's certificate alias namealgorithm
- XML signature algorithmtransformAlag
- XML signature transform algorithm
Those transfer constants are defined as
SAMLConstants.TRANSFORM_XXX
.ids
- list of id attribute values of nodes to be signed
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signWithWSSSAMLTokenProfile(org.w3c.dom.Document doc, java.security.cert.Certificate cert, java.lang.String assertionID, java.lang.String algorithm, java.util.List ids) throws XMLSignatureException
doc
- XML dom objectcert
- signer's CertificateassertionID
- assertion ID for the SAML Security Tokenalgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signed
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signWithWSSSAMLTokenProfile(org.w3c.dom.Document doc, java.security.cert.Certificate cert, java.lang.String assertionID, java.lang.String algorithm, java.util.List ids, java.lang.String wsfVersion) throws XMLSignatureException
doc
- XML dom objectcert
- signer's CertificateassertionID
- assertion ID for the SAML Security Tokenalgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signedwsfVersion
- the web services version that should be used.
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signWithSAMLToken(org.w3c.dom.Document doc, java.security.cert.Certificate cert, java.lang.String assertionID, java.lang.String algorithm, java.util.List ids) throws XMLSignatureException
doc
- XML dom objectcert
- signer's CertificateassertionID
- assertion ID for the SAML Security Tokenalgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signed
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signWithBinarySecurityToken(org.w3c.dom.Document doc, java.security.cert.Certificate cert, java.lang.String algorithm, java.util.List ids) throws XMLSignatureException
doc
- the XML DOM
document.cert
- Signer's certificatealgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signed
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signWithWSSX509TokenProfile(org.w3c.dom.Document doc, java.security.cert.Certificate cert, java.lang.String algorithm, java.util.List ids) throws XMLSignatureException
doc
- XML dom objectcert
- Signer's certificatealgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signed
XMLSignatureException
- if the document could not be signedpublic org.w3c.dom.Element signWithWSSX509TokenProfile(org.w3c.dom.Document doc, java.security.cert.Certificate cert, java.lang.String algorithm, java.util.List ids, java.lang.String wsfVersion) throws XMLSignatureException
doc
- XML dom objectcert
- Signer's certificatealgorithm
- XML signature algorithmids
- list of id attribute values of nodes to be signedwsfVersion
- the web services version that should be used.
XMLSignatureException
- if the document could not be signedpublic boolean verifyXMLSignature(org.w3c.dom.Document document) throws XMLSignatureException
document
- XML dom document whose signature to be verified
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(org.w3c.dom.Document document, java.lang.String certAlias) throws XMLSignatureException
document
- XML dom document whose signature to be verifiedcertAlias
- alias for Signer's certificate, this is used to search
signer's public certificate if it is not presented in
ds:KeyInfo
.
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(org.w3c.dom.Document document, java.security.cert.Certificate cert) throws XMLSignatureException
document
- XML dom document whose signature to be verifiedcert
- Signer's certificate, this is used to search signer's
public certificate if it is not presented in
ds:KeyInfo
.
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(org.w3c.dom.Element element) throws XMLSignatureException
element
- XML dom document whose signature to be verified
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(org.w3c.dom.Element element, java.lang.String certAlias) throws XMLSignatureException
element
- XML dom document whose signature to be verifiedcertAlias
- alias for Signer's certificate, this is used to search
signer's public certificate if it is not presented in
ds:KeyInfo
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(org.w3c.dom.Element element, java.lang.String idAttrName, java.lang.String certAlias) throws XMLSignatureException
element
- XML dom document whose signature to be verifiedidAttrName
- Attribute name for the id attributecertAlias
- alias for Signer's certificate, this is used to search
signer's public certificate if it is not presented in
ds:KeyInfo
.
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(java.lang.String XML) throws XMLSignatureException
XML
- XML string whose signature to be verified
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(java.lang.String XML, java.lang.String certAlias) throws XMLSignatureException
XML
- XML string whose signature to be verifiedcertAlias
- alias for Signer's certificate, this is used to search
signer's public certificate if it is not presented in
ds:KeyInfo
/
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(java.lang.String xmlString, java.lang.String idAttrName, java.lang.String certAlias) throws XMLSignatureException
xmlString
- XML string whose signature to be verifiedidAttrName
- Attribute name for the id attributecertAlias
- certAlias
for Signer's certificate,
this is used to search signer's public certificate if it is not
presented in ds:KeyInfo
.
XMLSignatureException
- if problem occurs during verification.public KeyProvider getKeyProvider()
KeyProvider
KeyProvider
public boolean verifyWSSSignature(org.w3c.dom.Document document, java.lang.String certAlias) throws XMLSignatureException
document
- XML dom document whose signature to be verifiedcertAlias
- alias for Signer's certificate, this is used to search
signer's public certificate if it is not presented in
ds:KeyInfo
.
XMLSignatureException
- if problem occurs during verificationpublic boolean verifyXMLSignature(java.lang.String wsfVersion, java.lang.String certAlias, org.w3c.dom.Document document) throws XMLSignatureException
wsfVersion
- the web services version that should be used.certAlias
- alias for Signer's certificate, this is used to search
signer's public certificate if it is not presented in
ds:KeyInfo
.document
- XML dom document whose signature to be verified
XMLSignatureException
- if problem occurs during verification.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |