credentials

package
v0.0.2-beta Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowCredential

type AllowCredential struct {
	Type       string                `json:"type"`
	ID         string                `json:"id"`
	Transports []CredentialTransport `json:"transports"`
}

type AllowCredentials

type AllowCredentials struct {
	Key      []AllowCredential `json:"key"`
	Webauthn []AllowCredential `json:"webauthn"`
}

type CredentialAssertion

type CredentialAssertion struct {
	CredID     string `json:"credId"`
	ClientData string `json:"clientData"`
	Signature  string `json:"signature"`
	Algorithm  string `json:"algorithm"`
}

type CredentialKind

type CredentialKind string
const (
	KeyCredential CredentialKind = "Key"
)

type CredentialTransport

type CredentialTransport string
const (
	USB      CredentialTransport = "usb"
	NFC      CredentialTransport = "nfc"
	BLE      CredentialTransport = "ble"
	Internal CredentialTransport = "internal"
)

type ICredentialSigner

type ICredentialSigner interface {
	Sign(userActionChallenge *UserActionChallenge) (*KeyAssertion, error)
}

For not it returns a KeyAssertion. But we can make it more generic afterward

type KeyAssertion

type KeyAssertion struct {
	Kind                CredentialKind      `json:"kind"`
	CredentialAssertion CredentialAssertion `json:"credentialAssertion"`
}

type UserActionChallenge

type UserActionChallenge struct {
	Challenge        string
	AllowCredentials *AllowCredentials
}

UserActionChallenge contains the challenge to sign

Jump to

Keyboard shortcuts

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