secret

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSize = 1 * mem.MiB

MaxSize is the maximum size of a secret.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iter added in v0.22.3

type Iter interface {
	// Next fetches the next secret entry. It returns
	// false when there are no more entries or once it
	// encounters an error.
	//
	// Once Next returns false, it returns false on any
	// subsequent Next call.
	Next() bool

	// Name returns the name of the latest fetched entry.
	// It returns the same name until Next is called again.
	//
	// As long as Next hasn't been called once or once Next
	// returns false, Name returns the empty string.
	Name() string

	// Close closes the Iter. Once closed, any subsequent
	// Next call returns false.
	//
	// Close returns the first error encountered while iterating
	// over the entires, if any. Otherwise, it returns the error
	// encountered while cleaning up any resources, if any.
	// Subsequent calls to Close return the same error.
	Close() error
}

Iter is an iterator over secrets.

type Secret

type Secret struct {
	// contains filtered or unexported fields
}

Secret is a generic secret, like a password, API key, or private key.

func NewSecret added in v0.22.3

func NewSecret(value []byte, owner kes.Identity) Secret

NewSecret returns a new generic Secret from the given value.

Its CreatedAt timestamp is time.Now and its CreatedBy identity is the owner.

func (*Secret) Bytes added in v0.22.3

func (s *Secret) Bytes() []byte

Bytes returns the Secret value.

func (*Secret) CreatedAt added in v0.22.3

func (s *Secret) CreatedAt() time.Time

CreatedAt returns the point in time when the secret has been created.

func (*Secret) CreatedBy added in v0.22.3

func (s *Secret) CreatedBy() kes.Identity

CreatedBy returns the identity that created the secret.

func (*Secret) MarshalBinary added in v0.22.3

func (s *Secret) MarshalBinary() ([]byte, error)

MarshalBinary returns the Secret's binary representation.

func (*Secret) ModTime added in v0.22.3

func (s *Secret) ModTime() time.Time

ModTime returns the most recent point in time at which the secret has been modified. If the secret has never been modified, its ModTime is equal to its CreatedAt time.

func (*Secret) Type added in v0.22.3

func (s *Secret) Type() kes.SecretType

Type returns the Secret's type.

func (*Secret) UnmarshalBinary added in v0.22.3

func (s *Secret) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshals the Secret's binary representation.

Jump to

Keyboard shortcuts

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