Documentation
¶
Index ¶
Constants ¶
const ( CmdMakeCredential = 0x01 CmdGetAssertion = 0x02 CmdGetInfo = 0x04 )
CTAP2 command codes (first byte of CmdCbor payload).
const ( StatusOK = byte(0x00) StatusInvalidCbor = byte(0x12) StatusCredentialExcluded = byte(0x19) // credential in excludeList already exists StatusUnsupportedAlg = byte(0x26) StatusOperationDenied = byte(0x27) StatusInvalidOption = byte(0x2C) // uv=true but authenticator cannot verify identity StatusNoCredentials = byte(0x2E) StatusUserActionTimeout = byte(0x2F) // CTAP 2.1 §8.2 / FIDO_ERR_USER_ACTION_TIMEOUT StatusNotAllowed = byte(0x30) StatusUVInvalid = byte(0x3F) )
CTAP2 status codes (first byte of CmdCbor response).
const ( AuthFlagUP = byte(0x01) // User Present AuthFlagUV = byte(0x04) // User Verified — only set when identity was verified (e.g. biometric) AuthFlagAT = byte(0x40) // Attested Credential Data present (MakeCredential only) )
authenticatorData flags (WebAuthn §6.1).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredDescriptor ¶
type CredStore ¶
type CredStore struct {
// contains filtered or unexported fields
}
CredStore persists resident credentials at ~/.config/linux-id/creds.json.
func NewCredStore ¶
func NewCredStore() *CredStore
NewCredStore returns a CredStore backed by ~/.config/linux-id/creds.json.
func (*CredStore) FindByRPID ¶
func (cs *CredStore) FindByRPID(rpIdHash []byte) ([]StoredCredential, error)
FindByRPID returns all credentials whose RPIDHash matches.
func (*CredStore) Save ¶
func (cs *CredStore) Save(c StoredCredential) error
Save appends c to the store, replacing any existing entry with the same CredID.
type GetAssertOptions ¶
type GetAssertOptions struct {
UV bool `cbor:"uv,omitempty"`
}
type GetAssertionRequest ¶
type GetAssertionRequest struct {
RPID string `cbor:"1,keyasint"`
ClientDataHash []byte `cbor:"2,keyasint"`
AllowList []CredDescriptor `cbor:"3,keyasint,omitempty"`
Options *GetAssertOptions `cbor:"5,keyasint,omitempty"`
}
GetAssertionRequest is the CTAP2 0x02 authenticatorGetAssertion request.
type MakeCredOptions ¶
type MakeCredentialRequest ¶
type MakeCredentialRequest struct {
ClientDataHash []byte `cbor:"1,keyasint"`
RP RPEntity `cbor:"2,keyasint"`
User UserEntity `cbor:"3,keyasint"`
PubKeyCredParams []CredParam `cbor:"4,keyasint"`
ExcludeList []CredDescriptor `cbor:"5,keyasint,omitempty"`
Options *MakeCredOptions `cbor:"7,keyasint,omitempty"`
}
MakeCredentialRequest is the CTAP2 0x01 authenticatorMakeCredential request.
type StoredCredential ¶
type StoredCredential struct {
CredID []byte `json:"credId"`
RPIDHash []byte `json:"rpIdHash"`
RPID string `json:"rpId"`
RPName string `json:"rpName"`
UserID []byte `json:"userId"`
UserName string `json:"userName"`
DisplayName string `json:"displayName"`
}
StoredCredential is a resident credential entry persisted to disk.