Class AttestationTrustPolicy

java.lang.Object
io.jans.fido2.service.processor.attestation.AttestationTrustPolicy

@ApplicationScoped public class AttestationTrustPolicy extends Object
Centralizes how attestation-trust failures are handled per attestation mode.

Core cryptographic and request-integrity checks (signature, challenge, RP-ID, client data) are always enforced by the callers regardless of mode. This policy governs only attestation provenance/trust failures (MDS lookup, certificate-chain trust, self-signed, certificate requirements, AAGUID extension, root cert, REVOKED status):

  • enforced - the failure is rejected (an exception is thrown).
  • monitor (the default) / disabled - the failure is logged, the credential is marked as not-trusted, and registration is allowed to complete cleanly.
  • Constructor Details

    • AttestationTrustPolicy

      public AttestationTrustPolicy()
  • Method Details

    • isEnforced

      public boolean isEnforced()
      Returns:
      true when the configured attestation mode is "enforced".
    • onTrustFailure

      public void onTrustFailure(AttestationErrorResponseType type, String message, AuthData authData, CredAndCounterData out)
      Handle an attestation-trust failure according to the configured mode.

      In "enforced" mode this throws and registration is rejected. In any other mode the failure is logged, the registration data is flagged as not-trusted, and control returns to the caller so the credential can still be registered.

      Parameters:
      type - the attestation error type used when rejecting in enforced mode
      message - human-readable reason for the trust failure
      authData - the parsed authenticator data (used for the AAGUID in the log line)
      out - the registration data being populated; marked not-trusted when tolerated