PasskeyCredential
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
A registered passkey: the durable record an IPasskeyCredentialStore keeps, and the read model the component returns and delivers on its events. One type, so a store maps exactly one shape and an application sees exactly what is stored.
4.2.0+- C#
- VB.NET
public sealed class PasskeyCredential
Public NotInheritable Class PasskeyCredential
The component fills every member at registration; a store materializes the same members from its rows. Byte arrays are compared by value, never by reference. The component validates and deep-copies every record and nested array returned by the store before using or exposing it; stores and callers must likewise treat records they receive as snapshots, not live rows. PublicKey, Algorithm, AttestationObject, ClientDataJson, Aaguid, Transports, Discoverable, BackupEligible, CreatedAt, UserVerified and Evidence never change after registration; SignCount, BackedUp and LastUsedAt change only through CommitAuthenticationAsync; Name changes only through RenameCredentialAsync.
The public key is not secret, but the credential id, user handle and raw registration evidence are privacy-sensitive identifiers. Do not log or serialize the record wholesale. The component logs only the bounded credential-id prefix described by its redaction contract.
Constructors
PasskeyCredential()
Initializes a new instance of the PasskeyCredential class. A store creates one per row it returns; the component creates one per registration.
Properties
Aaguid
Guid: Returns or sets the authenticator's AAGUID, built from the sixteen authenticator-data bytes in RFC 4122 order so that its string form is the value vendors publish; Empty when the authenticator sent zeros, which attestation "none" normally does. Advisory display metadata: with no attestation it is not verified provenance.
Algorithm
Int32: Returns or sets the COSE algorithm identifier of the key: -7 (ES256) or -257 (RS256). The verifier refuses every other value.
AttestationObject
Byte[]: Returns or sets the raw attestation object the browser returned at registration, exactly as received, or null for an imported credential. Kept so that a later attestation policy or a verifier fix can re-examine the registration.
BackedUp
Boolean: Returns or sets whether the credential is currently backed up — the BS flag of the most recent ceremony. Advisory; the application may show it or use it in its own risk policy.
BackupEligible
Boolean: Returns or sets whether the credential can be backed up to another device — the BE flag at registration, which an authenticator must never change afterwards. For a NativeVerified record, an assertion whose BE flag differs fails with CredentialMismatch; an ImportedLegacy record has no registration BE flag to compare with, and the check is skipped.
ClientDataJson
Byte[]: Returns or sets the raw clientDataJSON the browser returned at registration, exactly as received, or null for an imported credential.
ConcurrencyToken
Byte[]: Returns or sets the store's opaque concurrency token for the row — a version number, a row version, a timestamp, whatever the store uses to detect a concurrent write — or null or an empty array for a store that relies on SignCount alone; such a store cannot tell a credential deleted and registered again under the same id from the original while an authentication is in flight, and must detect that another way (CommitAuthenticationAsync). The component reads it with the record and hands it back byte for byte on ExpectedConcurrencyToken, a missing token as an empty array; it never interprets it.
CreatedAt
DateTimeOffset: Returns or sets when the credential was registered, in UTC.
CredentialId
Byte[]: Returns or sets the credential id the authenticator chose: 1 to 1023 bytes, unique per relying party. The store's primary lookup key together with RelyingPartyId.
Discoverable
Nullable<Boolean>: Returns or sets whether the credential is discoverable, as the browser's credProps extension reported it at registration; null when the browser did not say. False means only AuthenticateAsync can use it.
Evidence
PasskeyCredentialEvidence: Returns or sets what the registration evidence on this record is worth.
LastUsedAt
Nullable<DateTimeOffset>: Returns or sets when the credential last completed an authentication, in UTC, or null when it never has.
Name
String: Returns or sets the user-editable name of the passkey, or null. Display only; never a lookup key.
PublicKey
Byte[]: Returns or sets the credential public key as a COSE_Key in CTAP2 canonical CBOR, re-encoded by the component from the parsed key so that it carries exactly kty, alg, crv, x and y (ES256) or kty, alg, n and e (RS256) and nothing else.
RelyingPartyId
String: Returns or sets the normalized relying party id the credential is scoped to: a lower-case domain, no scheme, port or path. Every store lookup is scoped by it.
SignCount
UInt32: Returns or sets the last signature counter the authenticator reported: an unsigned 32-bit value that starts at the registration value and, when nonzero, only ever increases. Zero on both sides is normal for synced passkeys.
Transports
String[]: Returns or sets the transports the browser reported at registration, or an empty array when it reported none or sent something other than an array: unsigned text the client chose, normally AuthenticatorTransport values such as "internal", "hybrid", "usb", "nfc", "ble" and "smart-card". A registration stores only entries of lower-case ASCII letters, digits and hyphens: it drops entries of any other shape, and fails with InvalidResponse on more than 8 such entries or one longer than 32 characters. Records the store returns are handed back as stored, so treat every value as user-supplied text and encode it on output. Sent back as allowCredentials hints on a known-user authentication; never a security input.
UserHandle
Byte[]: Returns or sets the WebAuthn user handle: the 64 random bytes shared by every credential of this account for this relying party. An assertion's userHandle is compared with it exactly.
UserId
String: Returns or sets the application user id the credential is bound to.
UserVerified
Boolean: Returns or sets whether user verification is established for this credential: the UV flag at registration (WebAuthn Level 3 uvInitialized), never changed by an authentication. A credential registered without user verification keeps false: its later UV flags are not relied on, UserVerified is false for it, and it cannot sign in while UserVerification is Required. Its user registers a new passkey, with user verification, in its place. Before that, the application removes the old one: GetCredentialsAsync lists it with this value false, and DeleteCredentialAsync removes it. Under Required a registration leaves it out of the exclude list, so the authenticator that holds it can create the new passkey.