Versions in this module Expand all Collapse all v0 v0.9.0 Apr 14, 2022 Changes in this version + var ErrCredentialNotFound = errors.New("credential not found for the given index") + func SelectAuthenticator(att string, rrk *bool, uv string) p.AuthenticatorSelection + type AuthenticationOption func(*protocol.PublicKeyCredentialRequestOptions) + func WithAllowedCredentials(allowList []protocol.CredentialDescriptor) AuthenticationOption + func WithAssertionExtensions(extensions protocol.AuthenticationExtensions) AuthenticationOption + func WithChallenge(challenge []byte) AuthenticationOption + func WithUserVerification(userVerification protocol.UserVerificationRequirement) AuthenticationOption + type AuthenticationRequest struct + func (ar *AuthenticationRequest) CredentialRequestOptions() *protocol.CredentialRequestOptions + func (ar *AuthenticationRequest) Session() *SessionData + type AuthenticationResponse struct + func ParseAuthenticationResponse(user User, session *SessionData, response interface{}) (*AuthenticationResponse, error) + type Authenticator struct + AAGUID []byte + CloneWarning bool + SignCount uint32 + func (a *Authenticator) UpdateCounter(authDataCount uint32) + type Config struct + AttestationPreference protocol.ConveyancePreference + AuthenticatorSelection protocol.AuthenticatorSelection + Debug bool + RPDisplayName string + RPID string + RPIcon string + RPOrigin string + Timeout int + type Credential struct + AttestationType string + Authenticator Authenticator + ID []byte + PublicKey []byte + func MakeNewCredential(c *protocol.ParsedCredentialCreationData) (*Credential, error) + type RegistrationOption func(*protocol.PublicKeyCredentialCreationOptions) + func WithAuthenticatorSelection(authenticatorSelection protocol.AuthenticatorSelection) RegistrationOption + func WithConveyancePreference(preference protocol.ConveyancePreference) RegistrationOption + func WithExclusions(excludeList []protocol.CredentialDescriptor) RegistrationOption + func WithExtensions(extension protocol.AuthenticationExtensions) RegistrationOption + func WithResidentKeyRequirement(requirement protocol.ResidentKeyRequirement) RegistrationOption + type RegistrationRequest struct + func (rr *RegistrationRequest) CredentialCreationOptions() *protocol.CredentialCreationOptions + func (rr *RegistrationRequest) Session() *SessionData + type RegistrationResponse struct + func ParseRegistrationResponse(user User, session *SessionData, response interface{}) (*RegistrationResponse, error) + type SessionData struct + AllowedCredentialIDs [][]byte + Challenge string + Extensions protocol.AuthenticationExtensions + UserID []byte + UserVerification protocol.UserVerificationRequirement + type User interface + WebAuthnCredentials func() []Credential + WebAuthnDisplayName func() string + WebAuthnID func() []byte + WebAuthnIcon func() string + WebAuthnName func() string + WebAuthnRdlock func() + WebAuthnUpdateCredential func(idx int, cred Credential) error + WebAuthnWrlock func() + type WebAuthn struct + Config *Config + func New(config *Config) (*WebAuthn, error) + func (webauthn *WebAuthn) Authenticate(user User, opts ...AuthenticationOption) (*AuthenticationRequest, error) + func (webauthn *WebAuthn) CreateCredential(rr *RegistrationResponse) (*Credential, error) + func (webauthn *WebAuthn) Register(user User, opts ...RegistrationOption) (*RegistrationRequest, error) + func (webauthn *WebAuthn) VerifyAuthentication(ar *AuthenticationResponse) (*Credential, error)