Class SAML2Signature
java.lang.Object
org.keycloak.saml.processing.api.saml.v2.sig.SAML2Signature
Class that deals with SAML2 Signature
- Since:
- May 26, 2009
- Author:
- Anil.Saldhana@redhat.com, alessio.soldano@jboss.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigureIdAttribute(Document document) Sets the IDness of the ID attribute.static voidconfigureIdAttribute(Element element) voidsetDigestMethod(String digestMethod) voidsetNextSibling(Node sibling) voidsetSignatureIncludeKeyInfo(boolean val) Set to false, if you do not want to include keyinfo in the signaturevoidsetSignatureMethod(String signatureMethod) voidsetX509Certificate(X509Certificate x509Certificate) Set theX509Certificateif you desire to have the SignedInfo have X509 Data This method needs to be called before any of the sign methods.sign(Document doc, String referenceID, String keyName, KeyPair keyPair, String canonicalizationMethodType) Sign an Document at the rootvoidsignSAMLDocument(Document samlDocument, String keyName, KeyPair keypair, String canonicalizationMethodType) Sign a SAML Documentbooleanvalidate(Document signedDocument, KeyLocator keyLocator) Validate the SAML2 Document
-
Constructor Details
-
SAML2Signature
public SAML2Signature()
-
-
Method Details
-
getSignatureMethod
-
setSignatureMethod
-
getDigestMethod
-
setDigestMethod
-
setNextSibling
-
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
Set theX509Certificateif 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, String keyName, KeyPair keyPair, String canonicalizationMethodType) throws ParserConfigurationException, GeneralSecurityException, MarshalException, XMLSignatureException Sign an Document at the root- Parameters:
keyPair- Key Pair- Returns:
- Throws:
ParserConfigurationExceptionXMLSignatureExceptionMarshalExceptionGeneralSecurityException
-
signSAMLDocument
public void signSAMLDocument(Document samlDocument, String keyName, KeyPair keypair, String canonicalizationMethodType) throws ProcessingException Sign a SAML Document- Parameters:
samlDocument-keypair-- Throws:
ProcessingException
-
validate
Validate the SAML2 Document- Parameters:
signedDocument-keyLocator-- Returns:
- Throws:
ProcessingException
-
getNextSiblingOfIssuer
- Parameters:
doc-- Returns:
-
configureIdAttribute
Sets the IDness of the ID attribute. Santuario 1.5.1 does not assumes IDness based on attribute names anymore. This method should be called before signing/validating a saml document.
- Parameters:
document- SAML document to have its ID attribute configured.
-
configureIdAttribute
-