@ThreadSafe public class SAML2AssertionValidator extends Object
| Constructor and Description |
|---|
SAML2AssertionValidator(SAML2AssertionDetailsVerifier detailsVerifier)
Creates a new SAML 2.0 assertion validator.
|
| Modifier and Type | Method and Description |
|---|---|
SAML2AssertionDetailsVerifier |
getDetailsVerifier()
Gets the SAML 2.0 assertion details verifier.
|
static org.opensaml.saml2.core.Assertion |
parse(String xml)
Parses a SAML 2.0 assertion from the specified XML string.
|
org.opensaml.saml2.core.Assertion |
validate(org.opensaml.saml2.core.Assertion assertion,
Issuer expectedIssuer,
Key key)
Validates the specified SAML 2.0 assertion.
|
org.opensaml.saml2.core.Assertion |
validate(String xml,
Issuer expectedIssuer,
Key key)
Validates the specified SAML 2.0 assertion.
|
static void |
verifySignature(org.opensaml.xml.signature.Signature signature,
Key key)
Verifies the specified XML signature (HMAC, RSA or EC) with the
provided key.
|
public SAML2AssertionValidator(SAML2AssertionDetailsVerifier detailsVerifier)
detailsVerifier - The SAML 2.0 assertion details verifier. Must
not be null.public SAML2AssertionDetailsVerifier getDetailsVerifier()
public static org.opensaml.saml2.core.Assertion parse(String xml) throws ParseException
xml - The XML string. Must not be null.ParseException - If parsing of the assertion failed.public static void verifySignature(org.opensaml.xml.signature.Signature signature, Key key) throws BadSAML2AssertionException
signature - The XML signature. Must not be null.key - The key to verify the signature. Should be an
SecretKey instance for HMAC,
RSAPublicKey for RSA signatures or
ECPublicKey for EC signatures. Must not be
null.BadSAML2AssertionException - If the key type doesn't match the
signature, or the signature is
invalid.public org.opensaml.saml2.core.Assertion validate(org.opensaml.saml2.core.Assertion assertion, Issuer expectedIssuer, Key key) throws BadSAML2AssertionException
assertion - The SAML 2.0 assertion XML. Must not be
null.key - The key to verify the signature. Should be an
SecretKey instance for HMAC,
RSAPublicKey for RSA signatures or
ECPublicKey for EC signatures. Must not be
null.BadSAML2AssertionException - If the assertion is invalid.public org.opensaml.saml2.core.Assertion validate(String xml, Issuer expectedIssuer, Key key) throws BadSAML2AssertionException
xml - The SAML 2.0 assertion XML. Must not be null.key - The key to verify the signature. Should be an
SecretKey instance for HMAC, RSAPublicKey
for RSA signatures or ECPublicKey for EC
signatures. Must not be null.BadSAML2AssertionException - If the assertion is invalid.Copyright © 2016 Connect2id Ltd.. All rights reserved.