@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(String xml,
Issuer expectedIssuer,
RSAPublicKey rsaPublicKey)
Validates the specified RSA-signed SAML 2.0 assertion.
|
org.opensaml.saml2.core.Assertion |
validate(String xml,
Issuer expectedIssuer,
SecretKey hmacKey)
Validates the specified HMAC-protected SAML 2.0 assertion.
|
static void |
verifyHMAC(org.opensaml.xml.signature.Signature hmac,
SecretKey hmacKey)
Verifies the specified XML HMAC.
|
static void |
verifySignature(org.opensaml.xml.signature.Signature signature,
RSAPublicKey publicKey)
Verifies the specified XML signature.
|
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, RSAPublicKey publicKey) throws BadSAML2AssertionException
signature
- The XML signature. Must not be null
.publicKey
- The public RSA key to verify the signature. Must
not be null
.BadSAML2AssertionException
- If the signature is invalid.public static void verifyHMAC(org.opensaml.xml.signature.Signature hmac, SecretKey hmacKey) throws BadSAML2AssertionException
hmac
- The XML HMAC. Must not be null
.hmacKey
- The HMAC key. Must not be null
.BadSAML2AssertionException
- If the signature is invalid.public org.opensaml.saml2.core.Assertion validate(String xml, Issuer expectedIssuer, RSAPublicKey rsaPublicKey) throws BadSAML2AssertionException
xml
- The SAML 2.0 assertion XML. Must not be
null
.rsaPublicKey
- The public RSA key to validate the signature.
Must not be null
.BadSAML2AssertionException
- If the assertion is invalid.public org.opensaml.saml2.core.Assertion validate(String xml, Issuer expectedIssuer, SecretKey hmacKey) throws BadSAML2AssertionException
xml
- The SAML 2.0 assertion XML. Must not be null
.hmacKey
- The HMAC key. Must not be null
.BadSAML2AssertionException
- If the assertion is invalid.Copyright © 2015 Connect2id Ltd.. All Rights Reserved.