Package com.atlassian.crowd.plugin.saml
Class XmlDigitalSigner
java.lang.Object
com.atlassian.crowd.plugin.saml.XmlDigitalSigner
This helper class, part of the SAML-based Single Sign-On Reference Tool,
serves to digitally sign XML files, given the contents of the XML file, and a
pair of public and private keys. The file is signed as per the specifications
defined by SAML 2.0.
This class has been taken from the Google Apps SSO sample code:
http://code.google.com/apis/apps/sso/saml_reference_implementation.html
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
signXML
(String samlResponse, PublicKey publicKey, PrivateKey privateKey) Signs the specified xmlString with the pair of provided keys, as per the SAML 2.0 specifications.
-
Method Details
-
signXML
public static String signXML(String samlResponse, PublicKey publicKey, PrivateKey privateKey) throws SAMLException Signs the specified xmlString with the pair of provided keys, as per the SAML 2.0 specifications. Returns String format of signed XML if successfully signed, returns null otherwise.- Parameters:
samlResponse
- SAML Response XML file to be signedpublicKey
- public key to read the signed XMLprivateKey
- private key to sign the XML- Returns:
- String format of signed XML if signed correctly, null otherwise
- Throws:
SAMLException
-