public class Metadata extends Object
| Constructor and Description |
|---|
Metadata(Saml2Settings settings)
Constructs the Metadata object.
|
Metadata(Saml2Settings settings,
Calendar validUntilTime,
Integer cacheDuration)
Constructs the Metadata object.
|
Metadata(Saml2Settings settings,
Calendar validUntilTime,
Integer cacheDuration,
AttributeConsumingService attributeConsumingService)
Constructs the Metadata object.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getMetadataString() |
protected String |
postProcessXml(String metadataXml,
Saml2Settings settings)
Allows for an extension class to post-process the SAML metadata XML generated
for this metadata instance, in order to customize the result.
|
static String |
signMetadata(String metadata,
PrivateKey key,
X509Certificate cert,
String signAlgorithm)
Signs the metadata with the key/cert provided
|
static String |
signMetadata(String metadata,
PrivateKey key,
X509Certificate cert,
String signAlgorithm,
String digestAlgorithm)
Signs the metadata with the key/cert provided
|
public Metadata(Saml2Settings settings, Calendar validUntilTime, Integer cacheDuration, AttributeConsumingService attributeConsumingService) throws CertificateEncodingException
settings - Saml2Settings object. Setting datavalidUntilTime - Metadata's valid timecacheDuration - Duration of the cache in secondsattributeConsumingService - AttributeConsumingService of service providerCertificateEncodingExceptionpublic Metadata(Saml2Settings settings, Calendar validUntilTime, Integer cacheDuration) throws CertificateEncodingException
settings - Saml2Settings object. Setting datavalidUntilTime - Metadata's valid timecacheDuration - Duration of the cache in secondsCertificateEncodingExceptionpublic Metadata(Saml2Settings settings) throws CertificateEncodingException
settings - Saml2Settings object. Setting dataCertificateEncodingExceptionprotected String postProcessXml(String metadataXml, Saml2Settings settings)
This method is invoked at construction time, after all the other fields of this class have already been initialised. Its default implementation simply returns the input XML as-is, with no change.
metadataXml - the XML produced for this metadata instance by the standard
implementation provided by Metadatasettings - the settingsgetMetadataString()public final String getMetadataString()
public static String signMetadata(String metadata, PrivateKey key, X509Certificate cert, String signAlgorithm) throws XPathExpressionException, org.apache.xml.security.exceptions.XMLSecurityException
metadata - SAML Metadata XMLkey - Private Keycert - x509 Public certificatesignAlgorithm - Signature Algorithmorg.apache.xml.security.exceptions.XMLSecurityExceptionXPathExpressionExceptionpublic static String signMetadata(String metadata, PrivateKey key, X509Certificate cert, String signAlgorithm, String digestAlgorithm) throws XPathExpressionException, org.apache.xml.security.exceptions.XMLSecurityException
metadata - SAML Metadata XMLkey - Private Keycert - x509 Public certificatesignAlgorithm - Signature AlgorithmdigestAlgorithm - Digest Algorithmorg.apache.xml.security.exceptions.XMLSecurityExceptionXPathExpressionExceptionCopyright © 2022. All rights reserved.