Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assertion ¶
type Assertion struct {
ID string
Response struct {
AuthenticatorDataRaw RawURLBase64 `json:"authenticatorData"`
AuthenticatorData *AuthenticatorData `json:"-"`
ClientDataJSON RawURLBase64 `json:"clientDataJSON"`
ClientData ClientData `json:"-"`
Signature RawURLBase64 `json:"signature"`
VerifiableBytes []byte `json:"-"`
} `json:"response"`
}
Assertion is the CredentialRequestResponse containing the Authenticator Data
func ParseAssertion ¶
type AttestedCredentialData ¶
AttestedCredentialData represents the structure of attested credential data
func ParseAttestedCredentialData ¶
func ParseAttestedCredentialData(reader *bytes.Reader) (*AttestedCredentialData, error)
ParseAttestedCredentialData parses the attested credential data from the reader
type AuthenticatorData ¶
type AuthenticatorData struct {
RPIDHash []byte
Flags Flags
SignCount uint32
AttestedCredentialData *AttestedCredentialData
Extensions []byte
}
AuthenticatorData represents the authenticator device or service
func ParseAuthenticatorData ¶
func ParseAuthenticatorData(authData []byte) (*AuthenticatorData, error)
ParseAuthenticatorData parses the AuthenticatorData from decoded base64
type ClientData ¶
type Flags ¶
type Flags byte
Flags represents the flags byte in the authenticatorData
const ( FlagUP Flags = 1 << 0 // User presence tested FlagUV Flags = 1 << 2 // User verification performed FlagBE Flags = 1 << 3 // Backup Eligible (Multi Device) FlagBS Flags = 1 << 4 // Backup State (e.g. saved to iCloud) FlagAT Flags = 1 << 6 // Attested credential data included FlagED Flags = 1 << 7 // Extension data included )
func (Flags) HasAttestedCredentialData ¶
HasAttestedCredentialData (6:AT) is true when additional data is attached
func (Flags) HasExtensionData ¶
HasExtensionData (7:ED) is true when data about extensions is present
func (Flags) IsBackedUp ¶
IsBackedUp (4:BS) true if Browser Sync, iCloud, etc is active "Backup State"
func (Flags) IsMultiDeviceCredential ¶
IsMultiDeviceCredential (3:BE) true for Browser Sync, iCloud, etc - "Backup Eligible"
func (Flags) IsUserPresent ¶
IsUserPresent (0:UP) is true if the user is physically detected (NFC, Touch, BLE, etc)
func (Flags) String ¶
String returns a string representation of the Flags with human-readable status
func (Flags) UserVerified ¶
UserVerified (2:UV) is true when the user verified via password, PIN, Touch, Face, etc
type RawURLBase64 ¶
type RawURLBase64 []byte
RawURLBase64 is a newtype of string for base64 encoding
func (RawURLBase64) MarshalJSON ¶
func (b RawURLBase64) MarshalJSON() ([]byte, error)
MarshalJSON encodes the Base64 as a base64 byte array
func (*RawURLBase64) UnmarshalJSON ¶
func (b *RawURLBase64) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a base64 byte array into the Base64
type Registration ¶
type Registration struct {
ID string
Response struct {
AttestationCBOR RawURLBase64 `json:"attestationObject"`
AuthenticatorDataRaw RawURLBase64 `json:"authenticatorData"`
AuthenticatorData *AuthenticatorData `json:"-"`
ClientDataJSON RawURLBase64 `json:"clientDataJSON"`
ClientData ClientData `json:"-"`
PublicKeyAlgorithmInt int `json:"publicKeyAlgorithm"`
PublicKeyAlgorithm string `json:"publicKeyAlgorithmName"`
PublicKeyDER RawURLBase64 `json:"publicKey"`
PublicKeyECDSA *ecdsa.PublicKey `json:"-"`
Transports []string `json:"transports"`
} `json:"response"`
}
Registration is the CredentialCreationResponse containing the Attestation Object and PublicKey
func ParseRegistration ¶
func ParseRegistration(credentialCreationResponse []byte) (*Registration, error)