Class CoreCredentialRecordImpl

java.lang.Object
com.webauthn4j.authenticator.CoreAuthenticatorImpl
com.webauthn4j.credential.CoreCredentialRecordImpl
All Implemented Interfaces:
CoreAuthenticator, CoreCredentialRecord
Direct Known Subclasses:
CredentialRecordImpl

public class CoreCredentialRecordImpl extends CoreAuthenticatorImpl implements CoreCredentialRecord
Implementation of the CoreCredentialRecord interface representing a FIDO CTAP2 credential record. This class provides core functionality for managing credential data, user verification status, backup eligibility, and backup state.
  • Constructor Details

    • CoreCredentialRecordImpl

      public CoreCredentialRecordImpl(@NotNull @NotNull AttestationObject attestationObject)
      Constructs a new CoreCredentialRecordImpl from an attestation object. This constructor extracts necessary information from the attestation object including attested credential data, attestation statement, sign count, and flags.
      Parameters:
      attestationObject - the attestation object containing credential data and flags
    • CoreCredentialRecordImpl

      public CoreCredentialRecordImpl(@Nullable @Nullable AttestationStatement attestationStatement, @Nullable @Nullable Boolean uvInitialized, @Nullable @Nullable Boolean backupEligible, @Nullable @Nullable Boolean backupState, long counter, @NotNull @NotNull AttestedCredentialData attestedCredentialData, @Nullable @Nullable AuthenticationExtensionsAuthenticatorOutputs<RegistrationExtensionAuthenticatorOutput> authenticatorExtensions)
      Constructs a new CoreCredentialRecordImpl with the specified parameters. This constructor allows explicit setting of all credential record properties.
      Parameters:
      attestationStatement - the attestation statement, may be null
      uvInitialized - the user verification initialization status, may be null for backward compatibility
      backupEligible - the backup eligibility status, may be null for backward compatibility
      backupState - the backup state, may be null for backward compatibility
      counter - the signature counter value
      attestedCredentialData - the attested credential data, must not be null
      authenticatorExtensions - the authenticator extensions, may be null
  • Method Details

    • isUvInitialized

      public Boolean isUvInitialized()
      Gets the user verification (UV) initialization status of this credential.
      Specified by:
      isUvInitialized in interface CoreCredentialRecord
      Returns:
      `true` if user verification is initialized, `false` if user verification is not initialized, `null` if no data is available (for backward compatibility).
    • setUvInitialized

      public void setUvInitialized(boolean value)
      Sets the user verification (UV) initialization status of this credential.
      Specified by:
      setUvInitialized in interface CoreCredentialRecord
      Parameters:
      value - `true` to set the credential as user verification initialized, `false` otherwise.
    • isBackupEligible

      public Boolean isBackupEligible()
      Gets the backup eligibility status of this credential.
      Specified by:
      isBackupEligible in interface CoreCredentialRecord
      Returns:
      `true` if this credential is backup eligible, `false` if it is NOT backup eligible, `null` if no data is available (for backward compatibility).
    • setBackupEligible

      public void setBackupEligible(boolean value)
      Sets the backup eligibility status of this credential.
      Specified by:
      setBackupEligible in interface CoreCredentialRecord
      Parameters:
      value - `true` to mark the credential as backup eligible, `false` otherwise.
    • isBackedUp

      public Boolean isBackedUp()
      Gets the backup state of this credential.
      Specified by:
      isBackedUp in interface CoreCredentialRecord
      Returns:
      `true` if this credential is backed up, `false` if it is NOT backed up, `null` if no data is available (for backward compatibility).
    • setBackedUp

      public void setBackedUp(boolean value)
      Sets the backup state of this credential.
      Specified by:
      setBackedUp in interface CoreCredentialRecord
      Parameters:
      value - `true` to mark the credential as backed up, `false` otherwise.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class CoreAuthenticatorImpl
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class CoreAuthenticatorImpl