keys

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OidExtensionSerialNumber = []int{1, 3, 6, 1, 4, 1, 41482, 3, 7}

See https://developers.yubico.com/PIV/Introduction/PIV_attestation.html

Functions

func ConstructTufKey

func ConstructTufKey(ctx context.Context, signer signature.Signer, deprecated bool) (*data.PublicKey, error)

ConstructTufKey constructs a TUF public key from a given signer.

func ConstructTufKeyFromPublic

func ConstructTufKeyFromPublic(_ context.Context, pubKey crypto.PublicKey, deprecated bool) (*data.PublicKey, error)

ConstructTufKey constructs a TUF public key from a public key

func EcdsaTufKey

func EcdsaTufKey(pub *ecdsa.PublicKey, deprecatedType bool) (*data.PublicKey, error)

EcdsaTufKey returns a PEM-encoded TUF public key for an ecdsa key.

func ToCert

func ToCert(pemBytes []byte) (*x509.Certificate, error)

Types

type KeyValue

type KeyValue struct {
	PublicKey string `json:"public"`
}

func (*KeyValue) Unmarshal

func (kv *KeyValue) Unmarshal(pubKey *data.PublicKey) error

type SigningKey

type SigningKey struct {
	SerialNumber int
	PublicKey    *ecdsa.PublicKey
	DeviceCert   *x509.Certificate
	KeyCert      *x509.Certificate
}

SigningKey contains the serial number, public key, device cert, and key cert.

func SigningKeyFromDir

func SigningKeyFromDir(dirname string) (*SigningKey, error)

func ToSigningKey

func ToSigningKey(serialNumber int, pubKey []byte, deviceCert []byte, keyCert []byte) (*SigningKey, error)

func (SigningKey) Verify

func (key SigningKey) Verify(root *x509.Certificate) error

Jump to

Keyboard shortcuts

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