plugin

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PLUGIN_NAME                  = "fido2-hmac"
	RECIPIENT_HRP                = "age1" + PLUGIN_NAME
	IDENTITY_HRP                 = "age-plugin-" + PLUGIN_NAME + "-"
	RELYING_PARTY                = "age-encryption.org"
	STANZA_FORMAT_VERSION uint16 = 2
	MAGIC_IDENTITY               = "AGE-PLUGIN-FIDO2-HMAC-1VE5KGMEJ945X6CTRM2TF76"
)

Variables

This section is empty.

Functions

func FindDevice

func FindDevice() (*libfido2.Device, error)

func GenerateNewCli

func GenerateNewCli(algorithm libfido2.CredentialType, symmetric bool)

func GenerateNewCredential

func GenerateNewCredential(device *libfido2.Device, pin string, algorithm libfido2.CredentialType) (credId []byte, error error)

func GetHmacSecret

func GetHmacSecret(device *libfido2.Device, credId []byte, salt []byte, pin string) ([]byte, error)

func HasPinSet

func HasPinSet(device *libfido2.Device) (bool, error)

func IdentityV1

func IdentityV1() error

func RecipientV1

func RecipientV1() error

func StanzaArgsLine

func StanzaArgsLine(stanza *age.Stanza) string

func WaitForDevice

func WaitForDevice(maxWaitTimeSeconds int) (*libfido2.Device, error)

Types

type Fido2HmacIdentity

type Fido2HmacIdentity struct {
	Version uint16

	RequirePin bool
	Salt       []byte
	CredId     []byte
	// contains filtered or unexported fields
}

func ParseFido2HmacIdentity

func ParseFido2HmacIdentity(identity string) (*Fido2HmacIdentity, error)

func StanzaToIdentity

func StanzaToIdentity(stanza *age.Stanza) (*Fido2HmacIdentity, error)

func (*Fido2HmacIdentity) ClearSecret

func (i *Fido2HmacIdentity) ClearSecret()

func (*Fido2HmacIdentity) ObtainSecretFromToken

func (i *Fido2HmacIdentity) ObtainSecretFromToken(isPlugin bool, pin string) error

the pin can be passed if it's known already to avoid re-asking, but it's optional

func (*Fido2HmacIdentity) Recipient

func (i *Fido2HmacIdentity) Recipient() (*Fido2HmacRecipient, error)

func (*Fido2HmacIdentity) String

func (i *Fido2HmacIdentity) String() string

func (*Fido2HmacIdentity) Unwrap

func (i *Fido2HmacIdentity) Unwrap(stanzas []*age.Stanza) ([]byte, error)

func (*Fido2HmacIdentity) Wrap

func (i *Fido2HmacIdentity) Wrap(fileKey []byte) ([]*age.Stanza, error)

func (*Fido2HmacIdentity) X25519Identity

func (i *Fido2HmacIdentity) X25519Identity() (*age.X25519Identity, error)

type Fido2HmacRecipient

type Fido2HmacRecipient struct {
	Version        uint16
	TheirPublicKey []byte
	RequirePin     bool
	Salt           []byte
	CredId         []byte
}

func ParseFido2HmacRecipient

func ParseFido2HmacRecipient(recipient string) (*Fido2HmacRecipient, error)

func (*Fido2HmacRecipient) String

func (r *Fido2HmacRecipient) String() string

func (*Fido2HmacRecipient) Wrap

func (r *Fido2HmacRecipient) Wrap(fileKey []byte) ([]*age.Stanza, error)

func (*Fido2HmacRecipient) X25519Recipient

func (r *Fido2HmacRecipient) X25519Recipient() (*age.X25519Recipient, error)

Jump to

Keyboard shortcuts

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