Documentation ¶
Index ¶
- Constants
- func GetRandArray(size int) []byte
- func PrintAttestationObject(attest *AttestationObject)
- type AssertionReplyObjectParsed
- type AssertionReplyObjectRaw
- type AssertionRequestObject
- type AttCredDataObject
- type AttStmtObject_ES256
- type AttestationObject
- type AttestationObjectRaw
- type AuthData
- type AuthenticatorClientPIN
- type AuthenticatorClientPIN_Answer
- type AuthenticatorData
- type AuthenticatorGetInfo
- type AuthenticatorMakeCredential
- type CBOR_MSG
- type CTAP
- func (c *CTAP) ClientPIN_GetKeyAgreement() (*AuthenticatorClientPIN_Answer, error)
- func (c *CTAP) ClientPIN_GetPinToken(curPin string) (*AuthenticatorClientPIN_Answer, error)
- func (c *CTAP) ClientPIN_GetRetries() (*AuthenticatorClientPIN_Answer, error)
- func (c *CTAP) ClientPIN_Set(newPin string) (*AuthenticatorClientPIN_Answer, error)
- func (c *CTAP) GetAssertion(rpId string, cdh []byte, allowList [][]byte, pinAuth []byte, withHMAC bool, ...) (*AssertionReplyObjectParsed, error)
- func (c *CTAP) GetInfoCbor() (*AuthenticatorGetInfo, error)
- func (c *CTAP) MakeCredential(cdh []byte, rp_ID, rp_name string, user_Name, user_DisplayName string, ...) (*AttestationObject, error)
- func (c *CTAP) MakeSharedSecret() (*SharedSecret, error)
- func (c *CTAP) SendInitCommand() (*INIT_INFO, error)
- func (c *CTAP) SetDevice(dev *hidDevice)
- func (c *CTAP) Wink() error
- type ClientData
- type CoseKey
- type Device_Capability_flags
- type ExcludeCredential
- type ExtensionsList
- type ExtensionsListReply
- type ExtensionsListRequest
- type FIDO2
- type HmacSecret
- type HmacSecretRequest
- type INIT_INFO
- type Options
- type PubKeyCredParamsItem
- type PublicKeyCredentialDescriptor
- type PublicKeyCredentialRpEntity
- type PublicKeyCredentialUserEntity
- type SharedSecret
Constants ¶
View Source
const ( CMD_authenticatorGetAssertion = 0x02 CMD_authenticatorGetNextAssertion = 0x08 )
View Source
const ( CMD_authenticatorClientPIN = 0x06 CMD_authenticator_subCommand_getRetries = 0x01 CMD_authenticator_subCommand_getKeyAgreement = 0x02 CMD_authenticator_subCommand_setPin = 0x03 CMD_authenticator_subCommand_changePin = 0x04 CMD_authenticator_subCommand_getPinToken = 0x05 )
View Source
const CMD_CBOR uint8 = 0x10
View Source
const CMD_INIT uint8 = 0x06
View Source
const CMD_WINK uint8 = 0x08
View Source
const CMD_authenticatorGetInfo = 0x04
View Source
const CMD_authenticatorMakeCredential = 0x01
Variables ¶
This section is empty.
Functions ¶
func GetRandArray ¶ added in v0.1.2
func PrintAttestationObject ¶ added in v0.1.2
func PrintAttestationObject(attest *AttestationObject)
Types ¶
type AssertionReplyObjectParsed ¶ added in v0.1.2
type AssertionReplyObjectParsed struct { Credential *PublicKeyCredentialDescriptor AuthData *AuthData Signature []byte User *PublicKeyCredentialUserEntity NumberOfCredentials uint AuthDataRaw []byte }
type AssertionReplyObjectRaw ¶ added in v0.1.2
type AssertionReplyObjectRaw struct { Credential *PublicKeyCredentialDescriptor `cbor:"1,keyasint"` AuthData []byte `cbor:"2,keyasint"` Signature []byte `cbor:"3,keyasint"` User *PublicKeyCredentialUserEntity `cbor:"4,keyasint"` NumberOfCredentials uint `cbor:"5,keyasint"` }
type AssertionRequestObject ¶ added in v0.1.2
type AssertionRequestObject struct { RPID string `cbor:"1,keyasint"` ClientDataHash []byte `cbor:"2,keyasint"` AllowList []*PublicKeyCredentialDescriptor `cbor:"3,keyasint,omitempty"` Extensions *ExtensionsListRequest `cbor:"4,keyasint,omitempty"` Options *Options `cbor:"5,keyasint,omitempty"` PinAuth []byte `cbor:"6,keyasint,omitempty"` PinProtocol uint `cbor:"7,keyasint,omitempty"` }
type AttCredDataObject ¶ added in v0.1.2
type AttStmtObject_ES256 ¶ added in v0.1.2
type AttestationObject ¶ added in v0.1.2
type AttestationObject struct { Fmt string AuthData *AuthenticatorData AttStmt *AttStmtObject_ES256 }
type AttestationObjectRaw ¶ added in v0.1.2
type AuthData ¶ added in v0.1.2
type AuthData struct { RpIdHash []byte //32 byte Flags uint8 Counter uint32 AttCredData *AttCredDataObject Extensions *ExtensionsListReply }
type AuthenticatorClientPIN ¶ added in v0.1.2
type AuthenticatorClientPIN struct { PinProtocol uint `cbor:"1,keyasint"` SubCommand uint `cbor:"2,keyasint"` KeyAgreement *CoseKey `cbor:"3,keyasint,omitempty"` PinAuth []byte `cbor:"4,keyasint,omitempty"` NewPinEnc []byte `cbor:"5,keyasint,omitempty"` PinHashEnc []byte `cbor:"6,keyasint,omitempty"` }
type AuthenticatorClientPIN_Answer ¶ added in v0.1.2
type AuthenticatorData ¶ added in v0.1.2
type AuthenticatorData struct { RpIdHash []byte //32 byte Flags uint8 Counter uint32 AttCredData *AttCredDataObject Extensions *ExtensionsList }
type AuthenticatorGetInfo ¶ added in v0.1.2
type AuthenticatorMakeCredential ¶ added in v0.1.2
type AuthenticatorMakeCredential struct { ClientDataHash []byte `cbor:"1,keyasint,omitempty"` Rp *PublicKeyCredentialRpEntity `cbor:"2,keyasint,omitempty"` User *PublicKeyCredentialUserEntity `cbor:"3,keyasint,omitempty"` PubKeyCredParams []*PubKeyCredParamsItem `cbor:"4,keyasint,omitempty"` ExcludeList []*ExcludeCredential `cbor:"5,keyasint,omitempty"` Extensions *ExtensionsList `cbor:"6,keyasint,omitempty"` Options *Options `cbor:"7,keyasint,omitempty"` PinAuth []byte `cbor:"8,keyasint,omitempty"` PinProtocol uint `cbor:"9,keyasint,omitempty"` }
type CTAP ¶ added in v0.1.2
type CTAP struct {
// contains filtered or unexported fields
}
func (*CTAP) ClientPIN_GetKeyAgreement ¶ added in v0.1.2
func (c *CTAP) ClientPIN_GetKeyAgreement() (*AuthenticatorClientPIN_Answer, error)
func (*CTAP) ClientPIN_GetPinToken ¶ added in v0.1.2
func (c *CTAP) ClientPIN_GetPinToken(curPin string) (*AuthenticatorClientPIN_Answer, error)
func (*CTAP) ClientPIN_GetRetries ¶ added in v0.1.2
func (c *CTAP) ClientPIN_GetRetries() (*AuthenticatorClientPIN_Answer, error)
func (*CTAP) ClientPIN_Set ¶ added in v0.1.2
func (c *CTAP) ClientPIN_Set(newPin string) (*AuthenticatorClientPIN_Answer, error)
func (*CTAP) GetAssertion ¶ added in v0.1.2
func (*CTAP) GetInfoCbor ¶ added in v0.1.2
func (c *CTAP) GetInfoCbor() (*AuthenticatorGetInfo, error)
func (*CTAP) MakeCredential ¶ added in v0.1.2
func (*CTAP) MakeSharedSecret ¶ added in v0.1.2
func (c *CTAP) MakeSharedSecret() (*SharedSecret, error)
func (*CTAP) SendInitCommand ¶ added in v0.1.2
type ClientData ¶ added in v0.1.5
type ClientData struct { Type string `json:"type"` // "webauthn.create" or "webauthn.get" Challenge string `json:"challenge"` // the fun part for signing requests Origin string `json:"origin"` // the origin of the request CrossOrigin bool `json:"crossOrigin"` //defaults to false }
func (*ClientData) ToB64 ¶ added in v0.1.5
func (c *ClientData) ToB64() []byte
type CoseKey ¶ added in v0.1.2
type CoseKey struct { Kty int `cbor:"1,keyasint,omitempty"` Kid []byte `cbor:"2,keyasint,omitempty"` Alg int `cbor:"3,keyasint,omitempty"` KeyOpts int `cbor:"4,keyasint,omitempty"` IV []byte `cbor:"5,keyasint,omitempty"` CrvOrNOrK int `cbor:"-1,keyasint,omitempty"` // K for symmetric keys, Crv for elliptic curve keys, N for RSA modulus XOrE []byte `cbor:"-2,keyasint,omitempty"` // X for curve x-coordinate, E for RSA public exponent Y []byte `cbor:"-3,keyasint,omitempty"` // Y for curve y-cooridate D []byte `cbor:"-4,keyasint,omitempty"` }
Use cbor.RawMessage to delay unmarshaling (CrvOrNOrK's data type depends on Kty's value).
type Device_Capability_flags ¶ added in v0.1.2
type ExcludeCredential ¶ added in v0.1.2
type ExtensionsList ¶ added in v0.1.2
type ExtensionsList struct {
HmacSecret HmacSecret `cbor:"hmac-secret,omitempty"`
}
type ExtensionsListReply ¶ added in v0.1.2
type ExtensionsListRequest ¶ added in v0.1.2
type ExtensionsListRequest struct {
HmacSecret *HmacSecretRequest `cbor:"hmac-secret,omitempty"`
}
type FIDO2 ¶
func GetFido2Device ¶
type HmacSecret ¶ added in v0.1.2
type HmacSecret *bool
type HmacSecretRequest ¶ added in v0.1.2
type HmacSecretRequest struct { KeyAgreement *CoseKey `cbor:"1,keyasint,omitempty"` //publicKey used for shared Secret (CBOR Encoded 1:2,3:-25,-1:1,-2:x,-3:y) SaltEnc []byte `cbor:"2,keyasint,omitempty"` /*saltEnc(0x02): Encrypt one or two salts (Called salt1 (32 bytes) and salt2 (32 bytes)) using sharedSecret as follows: One salt case: AES256-CBC(sharedSecret, IV=0, salt1 (32 bytes)). Two salt case: AES256-CBC(sharedSecret, IV=0, salt1 (32 bytes) || salt2 (32 bytes)). */ SaltAuth []byte `cbor:"3,keyasint,omitempty"` }
type INIT_INFO ¶ added in v0.1.2
type INIT_INFO struct { Protocol_Version uint8 Major_Device_Version uint8 Minor_Device_Version uint8 Build_Device_Version uint8 Capability_flags Device_Capability_flags }
type PubKeyCredParamsItem ¶ added in v0.1.2
type PublicKeyCredentialDescriptor ¶ added in v0.1.2
type PublicKeyCredentialRpEntity ¶ added in v0.1.2
type PublicKeyCredentialUserEntity ¶ added in v0.1.2
type SharedSecret ¶ added in v0.1.2
type SharedSecret struct {}
Click to show internal directories.
Click to hide internal directories.