identity

package
v2.2.0 Latest Latest
Warning

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

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

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

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

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