assertion

package
v0.1.1 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

View Source
const (
	CMD_authenticatorGetAssertion     = 0x02
	CMD_authenticatorGetNextAssertion = 0x08
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssertionReplyObjectParsed

type AssertionReplyObjectParsed struct {
	Credential          *PublicKeyCredentialDescriptor
	AuthData            *AuthData
	Signature           []byte
	User                *PublicKeyCredentialUserEntity
	NumberOfCredentials uint
}

func Parser

func Parser(raw []byte, sharedSecret []byte) (*AssertionReplyObjectParsed, error)

type AssertionReplyObjectRaw

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

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        *credentials.Options             `cbor:"5,keyasint,omitempty"`
	PinAuth        []byte                           `cbor:"6,keyasint,omitempty"`
	PinProtocol    uint                             `cbor:"7,keyasint,omitempty"`
}

func GetAssertionRequest

func GetAssertionRequest(rpid string, cdh []byte, allowList [][]byte, pinAuth []byte, withHMAC bool, sharedSecret *credentials.SharedSecret, salt1 []byte, salt2 []byte) *AssertionRequestObject

type AuthData

type AuthData struct {
	RpIdHash    []byte //32 byte
	Flags       uint8
	Counter     uint32
	AttCredData *credentials.AttCredDataObject
	Extensions  *ExtensionsListReply
}

type ExtensionsListReply

type ExtensionsListReply struct {
	HmacSecret []byte `cbor:"hmac-secret,omitempty"`
	Secret     []byte `cbor:"-"`
}

type ExtensionsListRequest

type ExtensionsListRequest struct {
	HmacSecret *HmacSecretRequest `cbor:"hmac-secret,omitempty"`
}

type HmacSecretRequest

type HmacSecretRequest struct {
	KeyAgreement *credentials.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"`
}

func GetHmacSecretRequest

func GetHmacSecretRequest(sharedSecret *credentials.SharedSecret, salt1, salt2 []byte) *HmacSecretRequest

type PublicKeyCredentialDescriptor

type PublicKeyCredentialDescriptor struct {
	Type string `cbor:"type"` // "public-key"
	Id   []byte `cbor:"id"`   //credential ID (from attestation)
}

type PublicKeyCredentialUserEntity

type PublicKeyCredentialUserEntity struct {
	ID          []byte `cbor:"id"`
	Name        string `cbor:"name"`
	DisplayName string `cbor:"displayName"`
}

Jump to

Keyboard shortcuts

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