Class WebAuthnStoreKey
java.lang.Object
com.revetsec.webauthn.WebAuthnStoreKey
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe five authoritative record kinds. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares complete addresses.static @NonNull WebAuthnStoreKeyforAccountCredentialIndex(@NonNull String namespace, @NonNull String relyingPartyId, byte @NonNull [] userHandle) Address for the credential index of a 1–64-byte account handle.static @NonNull WebAuthnStoreKeyforAccountFence(@NonNull String namespace, @NonNull String relyingPartyId, byte @NonNull [] userHandle) Address for the active state and revocation fence of a 1–64-byte account handle.static @NonNull WebAuthnStoreKeyAddress for a 32-byte random ceremony ID.static @NonNull WebAuthnStoreKeyforCredential(@NonNull String namespace, @NonNull String relyingPartyId, byte @NonNull [] credentialId) Address for a credential ID of 1–1023 bytes.static @NonNull WebAuthnStoreKeyforNamespaceClock(@NonNull String namespace, @NonNull String relyingPartyId) Address for the authenticated immutable authority/minimum root of a namespace and RP.static @NonNull WebAuthnStoreKeyfromStoredForm(@NonNull String storageKey) Reconstructs an exact canonical persistence address, bounded to 583 ASCII characters.getKind()Returns the key's record kind.Returns the exact persistence address; do not log it.inthashCode()Returns the complete address hash.toString()Redacts the address.
-
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 namespacerelyingPartyId- the canonical RP IDceremonyId- 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 namespacerelyingPartyId- the canonical RP IDcredentialId- 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 namespacerelyingPartyId- the canonical RP IDuserHandle- 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 namespacerelyingPartyId- the canonical RP IDuserHandle- 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 namespacerelyingPartyId- 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 nullIllegalArgumentException- 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
-
hashCode
-
toString
-