identity

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	APIVersion  string      `json:"@apiVersion"`
	Kind        string      `json:"@kind"`
	Timestamp   time.Time   `json:"@timestamp"`
	Description string      `json:"@description"`
	Public      string      `json:"public"`
	Private     *PrivateKey `json:"private"`
	Signature   string      `json:"signature"`
}

Identity object to hold container sealer identity information.

func FromReader

func FromReader(r io.Reader) (*Identity, error)

FromReader extract identity instance from reader.

func New

func New(random io.Reader, description string, generator PrivateKeyGeneratorFunc) (*Identity, []byte, error)

New identity from description.

func (*Identity) Decrypt

func (i *Identity) Decrypt(ctx context.Context, t value.Transformer) (*key.JSONWebKey, error)

Decrypt private key with given transformer.

func (*Identity) HasPrivateKey

func (i *Identity) HasPrivateKey() bool

HasPrivateKey returns true if identity as a wrapped private.

func (*Identity) Verify added in v0.2.3

func (i *Identity) Verify() error

Verify the identity signature using its own public key.

type PrivateKey

type PrivateKey struct {
	Encoding string `json:"encoding,omitempty"`
	Content  string `json:"content"`
}

PrivateKey wraps encoded private and related informations.

type PrivateKeyGeneratorFunc added in v0.2.3

type PrivateKeyGeneratorFunc func(io.Reader) (*key.JSONWebKey, string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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