Versions in this module Expand all Collapse all v0 v0.1.0 Nov 18, 2026 Changes in this version + const AlgES256 + const AlgES384 + const AlgES512 + const AlgEdDSA + const AlgPS256 + const AlgPS384 + const AlgPS512 + const AlgRS256 + const AlgRS384 + const AlgRS512 + const FlagAttestedCredentialData + const FlagBackupEligible + const FlagBackupState + const FlagExtensionData + const FlagUserPresent + const FlagUserVerified + var ErrTooShort = errors.New("too short") + func Hostname() string — js/wasm + func Origin() string — js/wasm + func ParseAuthenticatorData(raw []byte, ad *AuthenticatorData) error + func ParseCOSEKey(coseKey []byte) (crypto.PublicKey, int, error) + func RecoverPublicKey(...) (*ecdsa.PublicKey, error) + func VerifySignature(coseKey, authData, clientDataJSON, signature []byte) error + type AssertionOptions struct + AllowCredentials []CredentialID + Challenge Bytes + Extensions map[string]any + Hints []string + RPID string + Timeout int + UserVerification string + func NewAssertionOptions() (*AssertionOptions, error) + type AssertionResponse struct + AuthenticatorAttachment string + AuthenticatorData Bytes + ClientDataJSON Bytes + ID string + RawID Bytes + Signature Bytes + Type string + UserHandle Bytes + func Get(opts *AssertionOptions) (*AssertionResponse, error) + func (r *AssertionResponse) UnmarshalJSON(data []byte) error + type Attestation struct + AttStmt cbor.RawMessage + AuthData AuthenticatorData + Format string + RawAuthData Bytes + func ParseAttestationObject(attestationObject []byte) (*Attestation, error) + func (att *Attestation) VerifyAttestationStatement(clientDataJSON []byte) error + type AttestationOptions struct + Attestation string + AttestationFormats []string + AuthenticatorSelection AuthenticatorSelection + Challenge Bytes + ExcludeCredentials []CredentialID + Extensions map[string]any + Hints []string + PubKeyCredParams []PubKeyCredParam + RelyingParty RelyingPartyEntity + Timeout int + User UserEntity + func NewAttestationOptions() (*AttestationOptions, error) + type AttestationResponse struct + AttestationObject Bytes + AuthenticatorAttachment string + ClientDataJSON Bytes + ID string + RawID Bytes + Transports []string + Type string + func Create(opts *AttestationOptions) (*AttestationResponse, error) + func (r *AttestationResponse) UnmarshalJSON(data []byte) error + type AttestedCredentials struct + AAGUID Bytes + COSEKey Bytes + ID Bytes + func (c AttestedCredentials) PublicKey() (crypto.PublicKey, error) + type AuthenticatorData struct + AttestedCredentialData bool + AttestedCredentials *AttestedCredentials + BackupEligible bool + BackupState bool + ExtensionData bool + Extensions Bytes + Flags byte + RPIDHash Bytes + SignCount uint32 + UserPresence bool + UserVerification bool + type AuthenticatorSelection struct + AuthenticatorAttachment string + RequireResidentKey bool + ResidentKey string + UserVerification string + type Bytes []byte + func MarshalCOSEKey(pub crypto.PublicKey) (Bytes, error) + func MarshalCOSEKeyWithAlg(pub crypto.PublicKey, alg int) (Bytes, error) + func ParseBytes(s string) (Bytes, error) + func (b *Bytes) UnmarshalJSON(data []byte) error + func (b Bytes) MarshalJSON() ([]byte, error) + func (b Bytes) String() string + type ClientData struct + Challenge string + CrossOrigin bool + Origin string + TokenBinding *TokenBinding + TopOrigin string + Type string + func ParseClientData(js []byte) (*ClientData, error) + func VerifyClientData(js []byte, wantType string, wantChallenge []byte, wantOrigin string) (*ClientData, error) + type CredentialID struct + ID Bytes + Transports []string + Type string + type FakeAuthenticator struct + func NewFakeAuthenticator() (*FakeAuthenticator, error) + func (a *FakeAuthenticator) Create(options *AttestationOptions) (clientDataJSON, attestationObject []byte, err error) + func (a *FakeAuthenticator) Get(options *AssertionOptions) (id, clientDataJSON, authData, signature, userHandle []byte, err error) + func (a *FakeAuthenticator) ResetSignCount() + func (a *FakeAuthenticator) RotateKeys() error + func (a *FakeAuthenticator) SetOrigin(orig string) + func (a *FakeAuthenticator) SetSelfAttestation(self bool) + type PubKeyCredParam struct + Alg int + Type string + type RelyingPartyEntity struct + ID string + Name string + type TokenBinding struct + ID string + Status string + type UserEntity struct + DisplayName string + ID Bytes + Name string + type VerifiedAssertion struct + AuthData AuthenticatorData + BackupEligible bool + BackupState bool + ClientData *ClientData + CredentialID Bytes + SignCount uint32 + UserHandle Bytes + UserVerified bool + func VerifyAssertion(resp *AssertionResponse, opts VerifyAssertionOptions) (*VerifiedAssertion, error) + type VerifiedCredential struct + AAGUID Bytes + Algorithm int + Attestation *Attestation + BackupEligible bool + BackupState bool + COSEKey Bytes + ClientData *ClientData + ID Bytes + PublicKey crypto.PublicKey + RPIDHash Bytes + SignCount uint32 + Transports []string + UserVerified bool + func VerifyAttestation(resp *AttestationResponse, opts VerifyAttestationOptions) (*VerifiedCredential, error) + type VerifyAssertionOptions struct + AllowedOrigins []string + COSEKey []byte + Challenge []byte + CredentialID []byte + IgnoreSignCount bool + Origin string + PrevSignCount uint32 + RPID string + RequireUserVerification bool + UserHandle []byte + type VerifyAttestationOptions struct + AllowedAlgorithms []int + AllowedOrigins []string + Challenge []byte + Origin string + RPID string + RequireUserVerification bool + VerifyAttestationStatement bool