com.sun.identity.saml.xmlsig
Interface SignatureProvider


public interface SignatureProvider

SignatureProvider is an interface to be implemented to sign and verify xml signature


Method Summary
 KeyProvider getKeyProvider()
          Get the real key provider
 void initialize(KeyProvider keyProvider)
          Initialize the key provider
 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.
 java.lang.String signXML(java.lang.String xmlString, java.lang.String certAlias)
          Sign the xml string using enveloped signatures.
 java.lang.String signXML(java.lang.String xmlString, java.lang.String certAlias, java.lang.String algorithm)
          Sign the xml string using enveloped signatures.
 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(java.lang.String xmlString)
          Verify the signature of the xml string
 boolean verifyXMLSignature(java.lang.String xmlString, java.lang.String certAlias)
          Verify the signature of the xml string
 

Method Detail

initialize

public void initialize(KeyProvider keyProvider)
Initialize the key provider
Parameters:
keyProvider - KeyProvider object

signXML

public org.w3c.dom.Element signXML(org.w3c.dom.Document doc,
                                   java.lang.String certAlias)
                            throws XMLSignatureException
Sign the xml document using enveloped signatures.
Parameters:
doc - XML dom object
certAlias - Signer's certificate alias name
Returns:
signature Element object
Throws:
XMLSignatureException - if the document could not be signed

signXML

public org.w3c.dom.Element signXML(org.w3c.dom.Document doc,
                                   java.lang.String certAlias,
                                   java.lang.String algorithm)
                            throws XMLSignatureException
Sign the xml document using enveloped signatures.
Parameters:
doc - XML dom object
certAlias - Signer's certificate alias name
algorithm - XML Signature Algorithm, such as SAMLConstants.ALGO_ID_SIGNATURE_DSA
Returns:
signature Element object
Throws:
XMLSignatureException - if the document could not be signed

signXML

public java.lang.String signXML(java.lang.String xmlString,
                                java.lang.String certAlias)
                         throws XMLSignatureException
Sign the xml string using enveloped signatures.
Parameters:
xmlString - xml string to be signed
certAlias - Signer's certificate alias name
Returns:
XML signature string
Throws:
XMLSignatureException - if the xml string could not be signed

signXML

public java.lang.String signXML(java.lang.String xmlString,
                                java.lang.String certAlias,
                                java.lang.String algorithm)
                         throws XMLSignatureException
Sign the xml string using enveloped signatures.
Parameters:
xmlString - xml string to be signed
certAlias - Signer's certificate alias name
algorithm - XML Signature Algorithm, such as SAMLConstants.ALGO_ID_SIGNATURE_DSA
Returns:
XML signature string
Throws:
XMLSignatureException - if the xml string could not be signed

verifyXMLSignature

public boolean verifyXMLSignature(org.w3c.dom.Element element)
                           throws XMLSignatureException
Verify the signature of the xml document
Parameters:
doc - XML dom document whose signature to be verified
Returns:
true if the xml signature is verified, false otherwise
Throws:
XMLSignatureException - if problem occurs during verification

verifyXMLSignature

public boolean verifyXMLSignature(org.w3c.dom.Element element,
                                  java.lang.String certAlias)
                           throws XMLSignatureException
Verify the signature of the xml document
Parameters:
doc - XML dom document whose signature to be verified
certAlias - certAlias Signer's certificate alias name
Returns:
true if the xml signature is verified, false otherwise
Throws:
XMLSignatureException - if problem occurs during verification

verifyXMLSignature

public boolean verifyXMLSignature(java.lang.String xmlString)
                           throws XMLSignatureException
Verify the signature of the xml string
Parameters:
xmlString - XML string whose signature to be verified
Returns:
true if the xml signature is verified, false otherwise
Throws:
XMLSignatureException - if problem occurs during verification

verifyXMLSignature

public boolean verifyXMLSignature(java.lang.String xmlString,
                                  java.lang.String certAlias)
                           throws XMLSignatureException
Verify the signature of the xml string
Parameters:
xmlString - XML string whose signature to be verified
certAlias - certAlias signer's certificate alias name
Returns:
true if the xml signature is verified, false otherwise
Throws:
XMLSignatureException - if problem occurs during verification

getKeyProvider

public KeyProvider getKeyProvider()
Get the real key provider
Returns:
KeyProvider