Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertionInternalResponse ¶
type AssertionInternalResponse struct { AuthenticatorData protocol.URLEncodedBase64 `json:"authenticatorData"` ClientDataJSON protocol.URLEncodedBase64 `json:"clientDataJSON"` Signature protocol.URLEncodedBase64 `json:"signature"` }
AssertionInternalResponse holds the internal data of an assertion response.
type AssertionResponse ¶
type AssertionResponse struct { ID string `json:"id"` RawID string `json:"rawId"` Type string `json:"type"` Response AssertionInternalResponse `json:"response"` }
AssertionResponse holds an assertion response.
type MockAuthenticator ¶
type MockAuthenticator struct {
CredSources map[string]*pubKeyCredSource
}
MockAuthenticator is a functional mock of a webauthn/FIDO authenticator device.
It supports fido-u2f attestation and assertion, using the P256 curve, with direct attestation, using a provided CA certificate and private key to serve as an Attestation CA.
func (*MockAuthenticator) Assert ¶
func (ma *MockAuthenticator) Assert(requesterOrigin string, params *protocol.PublicKeyCredentialRequestOptions) ([]byte, error)
Assert creates a credential assertion for a relying party that's already registered via Authenticate. Returns a JSON object containing the assertion response.
func (*MockAuthenticator) Authenticate ¶
func (ma *MockAuthenticator) Authenticate(parentCertPath, parentKeyPath, requesterOrigin string, params *protocol.CredentialCreation) ([]byte, error)
Authenticate generates a webauthn credential based on the provided parameters, signed by the given parent CA. Returns a JSON object containing the authentication response.
Click to show internal directories.
Click to hide internal directories.