identity

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 15 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"`
}

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(description string) (*Identity, []byte, error)

New identity from description.

func (*Identity) Decrypt

func (i *Identity) Decrypt(ctx context.Context, t value.Transformer) (*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.

type JSONWebKey

type JSONWebKey struct {
	Kty string `json:"kty"`
	Crv string `json:"crv"`
	X   string `json:"x"`
	D   string `json:"d"`
}

JSONWebKey holds internal container key attributes.

type PrivateKey

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

PrivateKey wraps encoded private and related informations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳