PicketLink Federation Core 2.1.6.Final-redhat-2

org.picketlink.identity.federation.api.saml.v2.sig
Class SAML2Signature

java.lang.Object
  extended by org.picketlink.identity.federation.api.saml.v2.sig.SAML2Signature

public class SAML2Signature
extends Object

Class that deals with SAML2 Signature

Since:
May 26, 2009
Author:
Anil.Saldhana@redhat.com, alessio.soldano@jboss.com

Constructor Summary
SAML2Signature()
           
 
Method Summary
 String getDigestMethod()
           
 Node getNextSiblingOfIssuer(Document doc)
           
 String getSignatureMethod()
           
 void setDigestMethod(String digestMethod)
           
 void setNextSibling(Node sibling)
           
 void setSignatureIncludeKeyInfo(boolean val)
          Set to false, if you do not want to include keyinfo in the signature
 void setSignatureMethod(String signatureMethod)
           
 Document sign(Document doc, String referenceID, KeyPair keyPair)
          Sign an Document at the root
 Document sign(Document doc, String idValueOfAssertion, KeyPair keypair, String referenceURI)
          Sign a document
 Document sign(RequestAbstractType request, KeyPair keypair)
          Sign an RequestType at the root
 Document sign(ResponseType response, KeyPair keypair)
          Sign an ResponseType at the root
 Document sign(ResponseType response, String idValueOfAssertion, KeyPair keypair, String referenceURI)
          Sign an assertion whose id value is provided in the response type
 void signSAMLDocument(Document samlDocument, KeyPair keypair)
          Sign a SAML Document
 boolean validate(Document signedDocument, PublicKey publicKey)
          Validate the SAML2 Document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAML2Signature

public SAML2Signature()
Method Detail

getSignatureMethod

public String getSignatureMethod()

setSignatureMethod

public void setSignatureMethod(String signatureMethod)

getDigestMethod

public String getDigestMethod()

setDigestMethod

public void setDigestMethod(String digestMethod)

setNextSibling

public void setNextSibling(Node sibling)

setSignatureIncludeKeyInfo

public void setSignatureIncludeKeyInfo(boolean val)
Set to false, if you do not want to include keyinfo in the signature

Parameters:
val -
Since:
v2.0.1

sign

public Document sign(RequestAbstractType request,
                     KeyPair keypair)
              throws SAXException,
                     IOException,
                     ParserConfigurationException,
                     GeneralSecurityException,
                     MarshalException,
                     XMLSignatureException
Sign an RequestType at the root

Parameters:
request -
keypair - Key Pair
digestMethod - (Example: DigestMethod.SHA1)
signatureMethod - (Example: SignatureMethod.DSA_SHA1)
Returns:
Throws:
ParserConfigurationException
IOException
SAXException
XMLSignatureException
MarshalException
GeneralSecurityException

sign

public Document sign(ResponseType response,
                     KeyPair keypair)
              throws ParserConfigurationException,
                     GeneralSecurityException,
                     MarshalException,
                     XMLSignatureException
Sign an ResponseType at the root

Parameters:
response -
keypair - Key Pair
digestMethod - (Example: DigestMethod.SHA1)
signatureMethod - (Example: SignatureMethod.DSA_SHA1)
Returns:
Throws:
ParserConfigurationException
XMLSignatureException
MarshalException
GeneralSecurityException

sign

public Document sign(Document doc,
                     String referenceID,
                     KeyPair keyPair)
              throws ParserConfigurationException,
                     GeneralSecurityException,
                     MarshalException,
                     XMLSignatureException
Sign an Document at the root

Parameters:
response -
keyPair - Key Pair
digestMethod - (Example: DigestMethod.SHA1)
signatureMethod - (Example: SignatureMethod.DSA_SHA1)
Returns:
Throws:
ParserConfigurationException
XMLSignatureException
MarshalException
GeneralSecurityException

sign

public Document sign(ResponseType response,
                     String idValueOfAssertion,
                     KeyPair keypair,
                     String referenceURI)
              throws ParserConfigurationException,
                     XPathException,
                     TransformerFactoryConfigurationError,
                     TransformerException,
                     GeneralSecurityException,
                     MarshalException,
                     XMLSignatureException
Sign an assertion whose id value is provided in the response type

Parameters:
response -
idValueOfAssertion -
keypair -
referenceURI -
Returns:
Throws:
ParserConfigurationException
TransformerException
TransformerFactoryConfigurationError
XPathException
XMLSignatureException
MarshalException
GeneralSecurityException

sign

public Document sign(Document doc,
                     String idValueOfAssertion,
                     KeyPair keypair,
                     String referenceURI)
              throws ParserConfigurationException,
                     XPathException,
                     TransformerFactoryConfigurationError,
                     TransformerException,
                     GeneralSecurityException,
                     MarshalException,
                     XMLSignatureException
Sign a document

Parameters:
doc -
idValueOfAssertion -
keypair -
referenceURI -
Returns:
Throws:
ParserConfigurationException
XPathException
TransformerFactoryConfigurationError
TransformerException
GeneralSecurityException
MarshalException
XMLSignatureException

signSAMLDocument

public void signSAMLDocument(Document samlDocument,
                             KeyPair keypair)
                      throws ProcessingException
Sign a SAML Document

Parameters:
samlDocument -
keypair -
Throws:
ProcessingException

validate

public boolean validate(Document signedDocument,
                        PublicKey publicKey)
                 throws ProcessingException
Validate the SAML2 Document

Parameters:
signedDocument -
publicKey -
Returns:
Throws:
ProcessingException

getNextSiblingOfIssuer

public Node getNextSiblingOfIssuer(Document doc)

PicketLink Federation Core 2.1.6.Final-redhat-2

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.