public class SAML2Signature extends Object
Constructor and Description |
---|
SAML2Signature() |
Modifier and Type | Method and Description |
---|---|
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) |
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)
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
|
public String getSignatureMethod()
public void setSignatureMethod(String signatureMethod)
public String getDigestMethod()
public void setDigestMethod(String digestMethod)
public void setNextSibling(Node sibling)
public void setSignatureIncludeKeyInfo(boolean val)
val
- public void setX509Certificate(X509Certificate x509Certificate)
X509Certificate
if you desire
to have the SignedInfo have X509 Data
This method needs to be called before any of the sign methods.x509Certificate
- public Document sign(RequestAbstractType request, KeyPair keypair) throws SAXException, IOException, ParserConfigurationException, GeneralSecurityException, MarshalException, XMLSignatureException
request
- keypair
- Key PairdigestMethod
- (Example: DigestMethod.SHA1)signatureMethod
- (Example: SignatureMethod.DSA_SHA1)ParserConfigurationException
IOException
SAXException
XMLSignatureException
MarshalException
GeneralSecurityException
public Document sign(ResponseType response, KeyPair keypair) throws ParserConfigurationException, GeneralSecurityException, MarshalException, XMLSignatureException
response
- keypair
- Key PairdigestMethod
- (Example: DigestMethod.SHA1)signatureMethod
- (Example: SignatureMethod.DSA_SHA1)ParserConfigurationException
XMLSignatureException
MarshalException
GeneralSecurityException
public Document sign(Document doc, String referenceID, KeyPair keyPair) throws ParserConfigurationException, GeneralSecurityException, MarshalException, XMLSignatureException
response
- keyPair
- Key PairdigestMethod
- (Example: DigestMethod.SHA1)signatureMethod
- (Example: SignatureMethod.DSA_SHA1)ParserConfigurationException
XMLSignatureException
MarshalException
GeneralSecurityException
public Document sign(ResponseType response, String idValueOfAssertion, KeyPair keypair, String referenceURI) throws ParserConfigurationException, XPathException, TransformerFactoryConfigurationError, TransformerException, GeneralSecurityException, MarshalException, XMLSignatureException
response
- idValueOfAssertion
- keypair
- referenceURI
- ParserConfigurationException
TransformerException
TransformerFactoryConfigurationError
XPathException
XMLSignatureException
MarshalException
GeneralSecurityException
public Document sign(Document doc, String idValueOfAssertion, KeyPair keypair, String referenceURI) throws ParserConfigurationException, XPathException, TransformerFactoryConfigurationError, TransformerException, GeneralSecurityException, MarshalException, XMLSignatureException
doc
- idValueOfAssertion
- keypair
- referenceURI
- ParserConfigurationException
XPathException
TransformerFactoryConfigurationError
TransformerException
GeneralSecurityException
MarshalException
XMLSignatureException
public void signSAMLDocument(Document samlDocument, KeyPair keypair) throws ProcessingException
samlDocument
- keypair
- ProcessingException
public boolean validate(Document signedDocument, PublicKey publicKey) throws ProcessingException
signedDocument
- publicKey
- ProcessingException
Copyright © 2016 JBoss by Red Hat. All rights reserved.