java.lang.Object
org.codelibs.saml2.core.settings.Metadata

public class Metadata extends Object
Metadata class of Java Toolkit. A class that contains methods related to the metadata of the SP
  • Constructor Details

    • Metadata

      public Metadata(Saml2Settings settings, Calendar validUntilTime, Integer cacheDuration, AttributeConsumingService attributeConsumingService)
      Constructs the Metadata object.
      Parameters:
      settings - Saml2Settings object. Setting data
      validUntilTime - Metadata's valid time
      cacheDuration - Duration of the cache in seconds
      attributeConsumingService - AttributeConsumingService of service provider
    • Metadata

      public Metadata(Saml2Settings settings, Calendar validUntilTime, Integer cacheDuration)
      Constructs the Metadata object.
      Parameters:
      settings - Saml2Settings object. Setting data
      validUntilTime - Metadata's valid time
      cacheDuration - Duration of the cache in seconds
    • Metadata

      public Metadata(Saml2Settings settings)
      Constructs the Metadata object.
      Parameters:
      settings - Saml2Settings object. Setting data
  • Method Details

    • postProcessXml

      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.

      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 by Metadata
      settings - the settings
      Returns:
      the post-processed XML for this metadata instance, which will then be returned by any call to getMetadataString()
    • getMetadataString

      public final String 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 XML
      key - Private Key
      cert - x509 Public certificate
      signAlgorithm - 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 XML
      key - Private Key
      cert - x509 Public certificate
      signAlgorithm - Signature Algorithm
      digestAlgorithm - Digest Algorithm
      Returns:
      string Signed Metadata