Documentation ¶
Index ¶
- type Key
- func (muk *Key) AuthenticateRaw(appHash, challengeHash []byte) ([]byte, error)
- func (muk *Key) Counter() uint32
- func (muk *Key) RegisterRaw(appHash, challengeHash []byte) ([]byte, error)
- func (muk *Key) SetCounter(counter uint32)
- func (muk *Key) SetPasswordless()
- func (muk *Key) SignAssertion(origin string, assertion *wanlib.CredentialAssertion) (*wanlib.CredentialAssertionResponse, error)
- func (muk *Key) SignCredentialCreation(origin string, cc *wanlib.CredentialCreation) (*wanlib.CredentialCreationResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct { KeyHandle []byte PrivateKey *ecdsa.PrivateKey // Cert is the Key attestation certificate. Cert []byte // PreferRPID instructs the Key to use favor using the RPID for Webauthn // ceremonies, even if the U2F App ID extension is present. PreferRPID bool // IgnoreAllowedCredentials allows the Key to sign a Webauthn // CredentialAssertion even it its KeyHandle is not among the allowed // credentials. IgnoreAllowedCredentials bool // SetUV sets the UV (user verification) bit on signatures if true. // SetUV should be paired only with WebAuthn login/registration methods, as // it makes Key mimic a WebAuthn device. SetUV bool // AllowResidentKey allows creation of resident credentials. // There's no actual change in Key's behavior other than allowing such requests // to proceed. // AllowResidentKey should be paired only with WebAuthn registration methods, // as it makes Key mimic a WebAuthn device. AllowResidentKey bool // contains filtered or unexported fields }
func CreateWithKeyHandle ¶
func (*Key) AuthenticateRaw ¶
AuthenticateRaw signs low-level U2F authentication data. Most callers should use either SignResponse or SignAssertion.
func (*Key) RegisterRaw ¶
RegisterRaw signs low-level U2F registration data. Most callers should use either RegisterResponse or SignCredentialCreation.
func (*Key) SetCounter ¶
func (*Key) SetPasswordless ¶
func (muk *Key) SetPasswordless()
SetPasswordless sets common passwordless options in Key. Options are AllowResidentKey, IgnoreAllowedCredentials and SetUV.
func (*Key) SignAssertion ¶
func (muk *Key) SignAssertion(origin string, assertion *wanlib.CredentialAssertion) (*wanlib.CredentialAssertionResponse, error)
SignAssertion signs a WebAuthn assertion following the U2F-compat-getAssertion algorithm.
func (*Key) SignCredentialCreation ¶
func (muk *Key) SignCredentialCreation(origin string, cc *wanlib.CredentialCreation) (*wanlib.CredentialCreationResponse, error)
SignCredentialCreation signs a WebAuthn credential creation request following the U2F-compat-makeCredential algorithm.
Click to show internal directories.
Click to hide internal directories.