Class SADParser
java.lang.Object
se.swedenconnect.opensaml.sweid.saml2.signservice.SADParser
Class for parsing and validation of SAD JWT:s.
- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A validator for verifying the SAD JWT. -
Method Summary
Modifier and TypeMethodDescriptionstatic SADParser.SADValidator
getValidator
(X509Certificate... validationCertificates) Returns a SAD validator initialized with a set of certificates that are to be used for JWT signature validation.static SADParser.SADValidator
getValidator
(org.opensaml.saml.saml2.metadata.EntityDescriptor idpMetadata) Returns a SAD validator initialized with the IdPEntityDescriptor
(metadata) from which the IdP signing key/certificate will be read (needed for JWT signature validation).static SADParser.SADValidator
getValidator
(MetadataProvider metadataProvider) Returns a SAD validator initialized with aMetadataProvider
instance.static SAD
Parses the supplied (encoded) JWT and returns the contained JWT.
-
Method Details
-
parse
Parses the supplied (encoded) JWT and returns the contained JWT.Note: The parse method does not peform any validation. Use the
SADParser.SADValidator
class for this purpose.- Parameters:
sadJwt
- the signed JWT holding the SAD- Returns:
- the SAD object
- Throws:
IOException
- for parsing errors
-
getValidator
Returns a SAD validator initialized with a set of certificates that are to be used for JWT signature validation. These certificates are the IdP signing certificates obtained from the IdP metadata entry.- Parameters:
validationCertificates
- certificate(s) to be used when verifying the JWT signature- Returns:
- a SADValidator instance
-
getValidator
Returns a SAD validator initialized with aMetadataProvider
instance. During JWT signature validation the IdP signature certificate will be obtained from the IdP metadata entry held by the metadata provider.- Parameters:
metadataProvider
- metadata provider- Returns:
- a SADValidator instance
-
getValidator
public static SADParser.SADValidator getValidator(org.opensaml.saml.saml2.metadata.EntityDescriptor idpMetadata) Returns a SAD validator initialized with the IdPEntityDescriptor
(metadata) from which the IdP signing key/certificate will be read (needed for JWT signature validation).- Parameters:
idpMetadata
- the IdP metadata- Returns:
- a SADValidator instance
-