credentials

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintAttestationObject

func PrintAttestationObject(attest *AttestationObject)

Types

type AttCredDataObject

type AttCredDataObject struct {
	Aaguid     []byte //16 byte
	CredIdLen  uint16 //big endian
	CredID     []byte //CredIdLen byte
	CredPubKey *CoseKey
}

type AttStmtObject_ES256

type AttStmtObject_ES256 struct {
	Alg int      `cbor:"alg"`
	Sig []byte   `cbor:"sig"`
	X5c [][]byte `cbor:"x5c"`
}

type AttestationObject

type AttestationObject struct {
	Fmt      string
	AuthData *AuthenticatorData
	AttStmt  *AttStmtObject_ES256
}

func Parser

func Parser(raw []byte) (*AttestationObject, error)

type AttestationObjectRaw

type AttestationObjectRaw struct {
	Fmt      string          `cbor:"1,keyasint"`
	AuthData []byte          `cbor:"2,keyasint"`
	AttStmt  cbor.RawMessage `cbor:"3,keyasint"`
}

type AuthenticatorData

type AuthenticatorData struct {
	RpIdHash    []byte //32 byte
	Flags       uint8
	Counter     uint32
	AttCredData *AttCredDataObject
	Extensions  *ExtensionsList
}

type AuthenticatorMakeCredential

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"`
}

func Make_Credentials

func Make_Credentials(cdh []byte, rp_ID, rp_name string, user_Name, user_DisplayName string, user_ID []byte, pinToken []byte, rk, withHMAC bool) *AuthenticatorMakeCredential

type CoseKey

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).

func GetKeyAgreement

func GetKeyAgreement(secret *SharedSecret) *CoseKey

type ExcludeCredential

type ExcludeCredential struct {
	ID   []byte `cbor:"id"`
	Type string `cbor:"type"`
}

type ExtensionsList

type ExtensionsList struct {
	HmacSecret HmacSecret `cbor:"hmac-secret,omitempty"`
}

type HmacSecret

type HmacSecret *bool

type Options

type Options struct {
	Rk bool `cbor:"rk,omitempty"`
	Uv bool `cbor:"uv,omitempty"`
	Up bool `cbor:"up,omitempty"`
}

type PubKeyCredParamsItem

type PubKeyCredParamsItem struct {
	Alg  int    `cbor:"alg"`
	Type string `cbor:"type"`
}

type PublicKeyCredentialRpEntity

type PublicKeyCredentialRpEntity struct {
	Name string `cbor:"name"`
	Id   string `cbor:"id"`
}

type PublicKeyCredentialUserEntity

type PublicKeyCredentialUserEntity struct {
	Id          []byte `cbor:"id"`
	Icon        string `cbor:"icon,omitempty"`
	Name        string `cbor:"name,omitempty"`
	DisplayName string `cbor:"displayName,omitempty"`
}

type SharedSecret

type SharedSecret struct {
	Publickey_X  []byte
	Publickey_Y  []byte
	SharedSecret []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL