Help us shape the future of Go! Take the 2026 Go Developer Survey

secrets

package
v0.2.26 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("credential cannot be decrypted with the configured key and binding")
View Source
var ErrKMSUnavailable = errors.New("KMS wrapping unavailable; check AWS credentials, key policy, approved key ARN and region")

Functions

This section is empty.

Types

type Binding

type Binding struct {
	OrgID        string
	ConnectionID string
	Version      int64
}

type Envelope

type Envelope struct {
	Version    int    `json:"version"`
	KeyID      string `json:"key_id"`
	WrappedKey []byte `json:"wrapped_key"`
	Ciphertext []byte `json:"ciphertext"`
}

type KMSConfig

type KMSConfig struct {
	Region         string
	KeyID          string
	PreviousKeyIDs []string
}

type Vault

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

func New

func New(keyID string, encodedKeys map[string]string) (*Vault, error)

func NewKMS

func NewKMS(ctx context.Context, c KMSConfig) (*Vault, error)

func (*Vault) GoString

func (v *Vault) GoString() string

func (*Vault) MarshalJSON

func (v *Vault) MarshalJSON() ([]byte, error)

func (*Vault) Open

func (v *Vault) Open(b Binding, e Envelope) ([]byte, error)

func (*Vault) OpenContext

func (v *Vault) OpenContext(ctx context.Context, b Binding, e Envelope) ([]byte, error)

func (*Vault) OpenRecord

func (v *Vault) OpenRecord(ctx context.Context, b Binding, e Envelope) ([]byte, error)

func (*Vault) Rewrap

func (v *Vault) Rewrap(b Binding, e Envelope) (Envelope, error)

func (*Vault) RewrapContext

func (v *Vault) RewrapContext(ctx context.Context, b Binding, e Envelope) (Envelope, error)

func (*Vault) Seal

func (v *Vault) Seal(b Binding, value []byte) (Envelope, error)

func (*Vault) SealContext

func (v *Vault) SealContext(ctx context.Context, b Binding, value []byte) (Envelope, error)

func (*Vault) SealRecord

func (v *Vault) SealRecord(ctx context.Context, b Binding, value []byte) (Envelope, error)

func (*Vault) String

func (v *Vault) String() string

Jump to

Keyboard shortcuts

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