key

package
v0.44.8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(rwc io.ReadWriteCloser, keyName string, config CreateConfig) ([]byte, error)

Create creates a new TPM key without attesting it and returns a serialized representation of it. The serialized format is compatible with the `go-attestation` format. Most of the code in this package is in fact copied from `go-attestation`, as large parts of its code are not publicly available at the moment. The code is useful, as it allows keys to be created in exactly the same way `go-attestation` creates them, except without attesting them. Both types of keys can be used for similar purposes, but only keys attested by an AK can be proved to be actually only resident in a TPM.

TODO: it might be an option to make some more things public in the `go-attestation` package, or to change some of the logic of the `NewKey` function that makes the AK optional.

Types

type Algorithm

type Algorithm string

Algorithm indicates an asymmetric algorithm to be used.

const (
	ECDSA Algorithm = "ECDSA"
	RSA   Algorithm = "RSA"
)

Algorithm types supported.

type CreateConfig

type CreateConfig struct {
	// Algorithm to be used, either RSA or ECDSA.
	Algorithm string
	// Size is used to specify the bit size of the key or elliptic curve. For
	// example, '256' is used to specify curve P-256.
	Size int
}

func (*CreateConfig) Validate added in v0.32.0

func (c *CreateConfig) Validate() error

type KeyConfig

type KeyConfig struct {
	Algorithm Algorithm
	Size      int
}

Jump to

Keyboard shortcuts

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