blob

package
v0.0.0-...-1219b78 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package blob implements a device credential that may be stored to disk as a marshaled blob.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceCredential

type DeviceCredential struct {
	Active bool
	fdo.DeviceCredential

	// Secrets that would otherwise be stored inside a TPM or other enclave.
	HmacSecret []byte
	PrivateKey Pkcs8Key
}

DeviceCredential contains all device state, including both public and private parts of keys and secrets.

func (*DeviceCredential) HMACs

func (dc *DeviceCredential) HMACs() (hmacSha256, hmacSha384 hash.Hash)

HMACs returns hmac hashes for SHA256 and SHA384.

func (*DeviceCredential) Public

func (dc *DeviceCredential) Public() crypto.PublicKey

Public returns the corresponding public key.

func (*DeviceCredential) Sign

func (dc *DeviceCredential) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs digest with the private key.

func (DeviceCredential) String

func (dc DeviceCredential) String() string

type Pkcs8Key

type Pkcs8Key struct {
	crypto.Signer
}

Pkcs8Key CBOR-encodes a private key to a byte string of PKCS8 DER content.

func (Pkcs8Key) IsValid

func (p Pkcs8Key) IsValid() bool

IsValid checks whether the key is valid for FDO Device Credential use.

func (Pkcs8Key) MarshalCBOR

func (p Pkcs8Key) MarshalCBOR() ([]byte, error)

MarshalCBOR implements cbor.Marshaler interface.

func (*Pkcs8Key) UnmarshalCBOR

func (p *Pkcs8Key) UnmarshalCBOR(data []byte) error

UnmarshalCBOR implements cbor.Unmarshaler interface.

Jump to

Keyboard shortcuts

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