com.atlassian.crowd.plugin.saml
Class XmlDigitalSigner

java.lang.Object
  extended by 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


Constructor Summary
XmlDigitalSigner()
           
 
Method Summary
static 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlDigitalSigner

public XmlDigitalSigner()
Method Detail

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


Copyright © 2013 Atlassian. All Rights Reserved.