Documentation
¶
Overview ¶
Package virtualwebauthn provides a set of helper tools for testing Webauthn authentication flows.
Index ¶
- func CreateAssertionResponse(rp RelyingParty, auth Authenticator, cred Credential, options AssertionOptions) string
- func CreateAttestationResponse(rp RelyingParty, auth Authenticator, cred Credential, ...) string
- type AssertionOptions
- type AttestationOptions
- type Authenticator
- type AuthenticatorOptions
- type Credential
- type Key
- type KeyType
- type RelyingParty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAssertionResponse ¶
func CreateAssertionResponse(rp RelyingParty, auth Authenticator, cred Credential, options AssertionOptions) string
func CreateAttestationResponse ¶
func CreateAttestationResponse(rp RelyingParty, auth Authenticator, cred Credential, options AttestationOptions) string
Types ¶
type AssertionOptions ¶
type AssertionOptions struct {
Challenge []byte `json:"challenge,omitempty"`
AllowCredentials []string `json:"allowCredentials,omitempty"`
RelyingPartyID string `json:"rpId,omitempty"`
}
func ParseAssertionOptions ¶
func ParseAssertionOptions(str string) (assertionOptions *AssertionOptions, err error)
type AttestationOptions ¶
type AttestationOptions struct {
Challenge []byte `json:"challenge,omitempty"`
ExcludeCredentials []string `json:"excludeCredentials,omitempty"`
RelyingPartyID string `json:"rpId,omitempty"`
RelyingPartyName string `json:"rpName,omitempty"`
UserID string `json:"user,omitempty"`
UserName string `json:"userName,omitempty"`
UserDisplayName string `json:"userDisplayName,omitempty"`
}
func ParseAttestationOptions ¶
func ParseAttestationOptions(str string) (attestationOptions *AttestationOptions, err error)
type Authenticator ¶
type Authenticator struct {
Options AuthenticatorOptions `json:"options"`
Aaguid [16]byte `json:"aaguid"`
Credentials []Credential `json:"credentials,omitempty"`
}
func NewAuthenticator ¶
func NewAuthenticator() Authenticator
func NewAuthenticatorWithOptions ¶
func NewAuthenticatorWithOptions(options AuthenticatorOptions) Authenticator
func (*Authenticator) AddCredential ¶
func (a *Authenticator) AddCredential(cred Credential)
func (*Authenticator) FindAllowedCredential ¶
func (a *Authenticator) FindAllowedCredential(options AssertionOptions) *Credential
type AuthenticatorOptions ¶
type Credential ¶
type Credential struct {
ID []byte `json:"id"`
Key *Key `json:"key"`
Counter uint32 `json:"counter,omitempty"`
}
func NewCredential ¶
func NewCredential(keyType KeyType) Credential
func NewCredentialWithImportedKey ¶
func NewCredentialWithImportedKey(keyType KeyType, keyData []byte) Credential
func (*Credential) IsAllowedForAssertion ¶
func (c *Credential) IsAllowedForAssertion(options AssertionOptions) bool
func (*Credential) IsExcludedForAttestation ¶
func (c *Credential) IsExcludedForAttestation(options AttestationOptions) bool
type Key ¶
type Key struct {
Type KeyType `json:"type"`
Data []byte `json:"data"`
// contains filtered or unexported fields
}
func (*Key) AttestationData ¶
type RelyingParty ¶
Click to show internal directories.
Click to hide internal directories.