Class SamlIdentityProviderMetadata

java.lang.Object
com.revetsec.saml.SamlIdentityProviderMetadata

One bounded, application-supplied SAML IdP metadata descriptor. No network fetch occurs and parsing does not approve the entity as an application connection. A verified signature authenticates content, not its age. The application owns retrieval, refresh, maximum age and expiry of any installed connection built from this snapshot.
Since:
1.0.0
  • Method Details

    • fromXmlResult

      Parses a single EntityDescriptor using the system UTC clock.
      Parameters:
      xml - application-supplied metadata bytes
      Returns:
      parsed metadata or a fixed failure
      Since:
      1.0.0
    • fromXmlResult

      public static @NonNull SamlIdentityProviderMetadataResult fromXmlResult(byte @NonNull [] xml, @NonNull String expectedEntityId)
      Selects one entity from a single or aggregate descriptor using the system UTC clock.
      Parameters:
      xml - application-supplied metadata bytes
      expectedEntityId - exact entity ID to select
      Returns:
      parsed metadata or a fixed failure
      Since:
      1.0.0
    • fromXmlResult

      public static @NonNull SamlIdentityProviderMetadataResult fromXmlResult(byte @NonNull [] xml, @Nullable String expectedEntityId, @NonNull Clock clock)
      Parses metadata with an explicit validation clock.
      Parameters:
      xml - application-supplied metadata bytes
      expectedEntityId - exact entity ID for aggregate selection, or null for a single descriptor
      clock - validation clock
      Returns:
      parsed metadata or a fixed failure
      Since:
      1.0.0
    • fromXmlResult

      public static @NonNull SamlIdentityProviderMetadataResult fromXmlResult(byte @NonNull [] xml, @Nullable String expectedEntityId, @NonNull Clock clock, @NonNull List<@NonNull PublicKey> trustedMetadataKeys)
      Parses metadata only when a pinned trusted key verifies a signature covering the selected entity or its containing aggregate. Embedded KeyInfo is never a trust anchor. A missing validUntil is accepted for application-managed freshness; a signature alone is not evidence of recency. Use fromXmlRequiringValidUntilResult(byte[], String, Clock, List) when a signed deadline is required. Any present covered deadline must still be in the future when parsing completes. This snapshot does not expire an installed connection.
      Parameters:
      xml - application-supplied metadata bytes
      expectedEntityId - exact entity ID for aggregate selection, or null for a single descriptor
      clock - validation clock
      trustedMetadataKeys - one to four application-pinned verification keys
      Returns:
      parsed metadata or a fixed failure
      Since:
      1.0.0
    • fromXmlRequiringValidUntilResult

      Requires a pinned signature and a future, signature-covered validUntil on the selected entity, its IdP role, or a verified containing aggregate. The earliest covered deadline wins. An unsigned parent's deadline cannot satisfy this policy. This checks expiry at parse completion, not publication age or freshness of the retrieval. Applications must cap trusted acquisition age and retire installed connections themselves; reparsing the same bytes must not reset that acquisition time.
      Parameters:
      xml - application-supplied metadata bytes
      expectedEntityId - exact entity ID, or null for a single descriptor
      clock - trusted validation clock
      trustedMetadataKeys - one to four application-pinned verification keys
      Returns:
      metadata with a verified future deadline, rejection, or provider/clock unavailability
      Since:
      1.0.0
    • getEntityId

      Returns the selected IdP entity ID.
      Returns:
      entity ID
      Since:
      1.0.0
    • getRedirectSingleSignOnService

      Returns the Redirect SSO endpoint when advertised.
      Returns:
      optional endpoint
      Since:
      1.0.0
    • getPostSingleSignOnService

      Returns the POST SSO endpoint when advertised.
      Returns:
      optional endpoint
      Since:
      1.0.0
    • getRedirectSingleLogoutService

      Returns the HTTP-Redirect SLO endpoint when advertised.
      Returns:
      optional endpoint
      Since:
      1.0.0
    • getPostSingleLogoutService

      Returns the HTTP-POST logout endpoint, if advertised.
      Returns:
      POST logout endpoint
      Since:
      1.0.0
    • getRedirectSingleLogoutResponseService

      Returns a distinct HTTP-Redirect SLO ResponseLocation, if advertised.
      Returns:
      response endpoint, or empty to use the request endpoint
      Since:
      1.0.0
    • getPostSingleLogoutResponseService

      Returns a distinct HTTP-POST SLO ResponseLocation, if advertised.
      Returns:
      response endpoint, or empty to use the request endpoint
      Since:
      1.0.0
    • getSigningCertificates

      Returns signing certificates from this metadata, including rollover certificates.
      Returns:
      immutable certificate list
      Since:
      1.0.0
    • wantsAuthnRequestsSigned

      Reports whether the IdP requests signed AuthnRequests.
      Returns:
      true if requested
      Since:
      1.0.0
    • getValidUntil

      Returns the earliest applicable metadata expiry when present. Pinned-signature parsing includes only deadlines covered by that proof; raw parsing does not establish trust. The application must stop using an installed connection at its effective deadline.
      Returns:
      optional expiry
      Since:
      1.0.0
    • getAuthorizedIdentifierScopes

      Returns literal identifier scopes advertised by this metadata. The application still approves the scopes before building a connection.
      Returns:
      immutable literal scopes
      Since:
      1.0.0
    • toString

      Redacts certificate and endpoint data.
      Overrides:
      toString in class Object
      Returns:
      redacted description
      Since:
      1.0.0