org.keycloak.saml.processing.api.saml.v2.sig

## Class SAML2Signature

- java.lang.Object
- - org.keycloak.saml.processing.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

    Constructors
    Constructor and Description
    `SAML2Signature()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDigestMethod()`
    `Node` | `getNextSiblingOfIssuer(Document doc)` Given a `Document`, find the `Node` which is the sibling of the Issuer element
    `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)`
    `void` | `setX509Certificate(X509Certificate x509Certificate)` Set the `X509Certificate` if you desire to have the SignedInfo have X509 Data This method needs to be called before any of the sign methods.
    `Document` | `sign(Document doc, String referenceID, KeyPair keyPair, String canonicalizationMethodType)` Sign an Document at the root
    `void` | `signSAMLDocument(Document samlDocument, KeyPair keypair, String canonicalizationMethodType)` 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

    - #### setX509Certificate

          public void setX509Certificate(X509Certificate x509Certificate)

      Set the `X509Certificate` if you desire to have the SignedInfo have X509 Data This method needs to be called before any of the sign methods.
      Parameters:
        `x509Certificate` -
      Since:
        v2.5.0

    - #### sign

          public Document sign(Document doc,
                               String referenceID,
                               KeyPair keyPair,
                               String canonicalizationMethodType)
                        throws ParserConfigurationException,
                               GeneralSecurityException,
                               MarshalException,
                               XMLSignatureException

      Sign an Document at the root
      Parameters:
        `keyPair` - Key Pair
      Returns:
      Throws:
        `ParserConfigurationException`
        `XMLSignatureException`
        `MarshalException`
        `GeneralSecurityException`

    - #### signSAMLDocument

          public void signSAMLDocument(Document samlDocument,
                                       KeyPair keypair,
                                       String canonicalizationMethodType)
                                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)

      Given a `Document`, find the `Node` which is the sibling of the Issuer element
      Parameters:
        `doc` -
      Returns:

Copyright © 2016 JBoss by Red Hat. All rights reserved.