java.lang.Object
org.codelibs.saml2.core.settings.Metadata
Metadata class of Java Toolkit.
A class that contains methods related to the metadata of the SP
-
Constructor Summary
ConstructorsConstructorDescriptionMetadata(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. -
Method Summary
Modifier and TypeMethodDescriptionfinal Stringprotected StringpostProcessXml(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 StringsignMetadata(String metadata, PrivateKey key, X509Certificate cert, String signAlgorithm) Signs the metadata with the key/cert providedstatic StringsignMetadata(String metadata, PrivateKey key, X509Certificate cert, String signAlgorithm, String digestAlgorithm) Signs the metadata with the key/cert provided
-
Constructor Details
-
Metadata
public Metadata(Saml2Settings settings, Calendar validUntilTime, Integer cacheDuration, AttributeConsumingService attributeConsumingService) Constructs the Metadata object.- Parameters:
settings- Saml2Settings object. Setting datavalidUntilTime- Metadata's valid timecacheDuration- Duration of the cache in secondsattributeConsumingService- AttributeConsumingService of service provider
-
Metadata
Constructs the Metadata object.- Parameters:
settings- Saml2Settings object. Setting datavalidUntilTime- Metadata's valid timecacheDuration- Duration of the cache in seconds
-
Metadata
Constructs the Metadata object.- Parameters:
settings- Saml2Settings object. Setting data
-
-
Method Details
-
postProcessXml
Allows for an extension class to post-process the SAML metadata XML generated for this metadata instance, in order to customize the result.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.
- Parameters:
metadataXml- the XML produced for this metadata instance by the standard implementation provided byMetadatasettings- the settings- Returns:
- the post-processed XML for this metadata instance, which will then be
returned by any call to
getMetadataString()
-
getMetadataString
- Returns:
- the metadata
-
signMetadata
public static String signMetadata(String metadata, PrivateKey key, X509Certificate cert, String signAlgorithm) Signs the metadata with the key/cert provided- Parameters:
metadata- SAML Metadata XMLkey- Private Keycert- x509 Public certificatesignAlgorithm- Signature Algorithm- Returns:
- string Signed Metadata
-
signMetadata
public static String signMetadata(String metadata, PrivateKey key, X509Certificate cert, String signAlgorithm, String digestAlgorithm) Signs the metadata with the key/cert provided- Parameters:
metadata- SAML Metadata XMLkey- Private Keycert- x509 Public certificatesignAlgorithm- Signature AlgorithmdigestAlgorithm- Digest Algorithm- Returns:
- string Signed Metadata
-