memkm

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package memkm provides an in-memory keys.ManagerInterface implementation. Used for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BumpName

func BumpName(name string) string

BumpName returns a given name with a counter suffix added at 1 or increased by 1, following '_'.

Types

type T

type T struct {
	Signer                *nonprod.Signer
	RootKeyName           string
	PrimarySigningKeyName string
}

T is the type of the memkm key manager.

func TestOnlyT

func TestOnlyT() *T

TestOnlyT returns a T instance populated with pre-generated keys for development.

func (*T) AddFlags

func (k *T) AddFlags(*cobra.Command)

AddFlags adds any implementation-specific flags for this command component.

func (*T) CertificateTemplate

func (k *T) CertificateTemplate(ctx context.Context, issuer *x509.Certificate, subjectPubKey any) (*x509.Certificate, error)

CertificateTemplate returns a certificate template that will be used for signing.

func (*T) CreateFirstSigningKey

func (k *T) CreateFirstSigningKey(ctx context.Context) (string, error)

CreateFirstSigningKey is called during CA bootstrapping to create the first signing key that can be used for endorse.

func (*T) CreateNewRootKey

func (k *T) CreateNewRootKey(ctx context.Context) (string, error)

CreateNewRootKey establishes a new key for use as the root CA key.

func (*T) CreateNewSigningKeyVersion

func (k *T) CreateNewSigningKeyVersion(ctx context.Context) (string, error)

CreateNewSigningKeyVersion is callable after CreateNewSigningKey, and is meant for key rotation. The signing key's name ought to be available from the context.

func (*T) DestroyKeyVersion

func (k *T) DestroyKeyVersion(_ context.Context, keyVersionName string) error

DestroyKeyVersion destroys a single key version.

func (*T) InitContext

func (k *T) InitContext(ctx context.Context) (context.Context, error)

InitContext extends the given context with whatever else the component needs before execution.

func (*T) PersistentPreRunE

func (k *T) PersistentPreRunE(*cobra.Command, []string) error

PersistentPreRunE returns an error if the results of the parsed flags constitute an error.

func (*T) Wipeout

func (k *T) Wipeout(context.Context) error

Wipeout destroys all keys managed by this manager.

Jump to

Keyboard shortcuts

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