Documentation ¶
Overview ¶
Package passkey implements the support of Webauthn credentials for authentication. It is based on the W3C's "Web Authentication: An API for accessing Public Key Credentials" https://www.w3.org/TR/webauthn-2/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientData ¶
type ClientData struct { Challenge string `json:"challenge"` Origin string `json:"origin"` CredType string `json:"type"` }
Client data for signature: https://www.w3.org/TR/webauthn-1/#sec-client-data
type Credential ¶
type Credential struct { Id string Rp string UserName string Algorithm string SecretKey *ecdsa.PrivateKey Counter uint32 Flags CredentialFlags }
Structure to store information and key of public key credential.
func CreateCredential ¶
func CreateCredential(rp string, user string, flags CredentialFlags) (*Credential, error)
Implementation of the authenticatorMakeCredential Operation: https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred
func (*Credential) GetAssertion ¶
func (cred *Credential) GetAssertion(challenge string, origin string) (*Response, error)
Implementation of the authenticatorGetAssertion Operation: https://www.w3.org/TR/webauthn-2/#authenticatorgetassertion
type CredentialFlags ¶
type CredentialFlags struct { UserPresent bool UserVerified bool AttestationData bool ExtensionData bool }
Flags for the credential parameters: https://www.w3.org/TR/webauthn-2/#flags