Class WebAuthnStoreKey

java.lang.Object
com.revetsec.webauthn.WebAuthnStoreKey

@Immutable public final class WebAuthnStoreKey extends Object
Typed, namespace-bound authoritative address. Binary identifiers are represented only by canonical SHA-256 digests in the stored address. Constructing a key confers no protocol authority. The storage form is sensitive and must not be logged.
Since:
1.0.0
  • Method Details

    • forCeremony

      public static @NonNull WebAuthnStoreKey forCeremony(@NonNull String namespace, @NonNull String relyingPartyId, byte @NonNull [] ceremonyId)
      Address for a 32-byte random ceremony ID.
      Parameters:
      namespace - the credential namespace
      relyingPartyId - the canonical RP ID
      ceremonyId - the decoded random ceremony ID
      Returns:
      the typed address
      Since:
      1.0.0
    • forCredential

      public static @NonNull WebAuthnStoreKey forCredential(@NonNull String namespace, @NonNull String relyingPartyId, byte @NonNull [] credentialId)
      Address for a credential ID of 1–1023 bytes.
      Parameters:
      namespace - the credential namespace
      relyingPartyId - the canonical RP ID
      credentialId - the browser credential ID
      Returns:
      the typed address
      Since:
      1.0.0
    • forAccountCredentialIndex

      public static @NonNull WebAuthnStoreKey forAccountCredentialIndex(@NonNull String namespace, @NonNull String relyingPartyId, byte @NonNull [] userHandle)
      Address for the credential index of a 1–64-byte account handle.
      Parameters:
      namespace - the credential namespace
      relyingPartyId - the canonical RP ID
      userHandle - the opaque account handle
      Returns:
      the typed address
      Since:
      1.0.0
    • forAccountFence

      public static @NonNull WebAuthnStoreKey forAccountFence(@NonNull String namespace, @NonNull String relyingPartyId, byte @NonNull [] userHandle)
      Address for the active state and revocation fence of a 1–64-byte account handle.
      Parameters:
      namespace - the credential namespace
      relyingPartyId - the canonical RP ID
      userHandle - the opaque account handle
      Returns:
      the typed address
      Since:
      1.0.0
    • forNamespaceClock

      public static @NonNull WebAuthnStoreKey forNamespaceClock(@NonNull String namespace, @NonNull String relyingPartyId)
      Address for the authenticated immutable authority/minimum root of a namespace and RP.
      Parameters:
      namespace - the credential namespace
      relyingPartyId - the canonical RP ID
      Returns:
      the namespace clock address
      Since:
      1.0.0
    • fromStoredForm

      Reconstructs an exact canonical persistence address, bounded to 583 ASCII characters. This supports application-owned inventory and reseal of revoked credentials whose raw IDs are no longer listed. It checks address syntax only: it does not authenticate a record, approve a namespace, authorize maintenance, or construct a verification proof. The relying party still checks scope and permanent-record eligibility before reseal; ceremony addresses can round-trip but cannot be resealed. Treat the input and returned address as sensitive.
      Parameters:
      storageKey - the exact address from a trusted persistence inventory
      Returns:
      the reconstructed typed address without rehashing its identifier digest
      Throws:
      NullPointerException - if storageKey is null
      IllegalArgumentException - if the address is not canonical or exceeds its bounds
      Since:
      1.0.0
    • getStorageKey

      Returns the exact persistence address; do not log it.
      Returns:
      the storage address
      Since:
      1.0.0
    • getKind

      Returns the key's record kind.
      Returns:
      the record kind
      Since:
      1.0.0
    • equals

      public boolean equals(@Nullable Object other)
      Compares complete addresses. @since 1.0.0
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Returns the complete address hash. @since 1.0.0
      Overrides:
      hashCode in class Object
    • toString

      Redacts the address. @since 1.0.0
      Overrides:
      toString in class Object