Class XmlDigitalSigner

java.lang.Object
com.atlassian.crowd.plugin.saml.XmlDigitalSigner

public class XmlDigitalSigner extends Object
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 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 signed
      publicKey - public key to read the signed XML
      privateKey - private key to sign the XML
      Returns:
      String format of signed XML if signed correctly, null otherwise
      Throws:
      SAMLException