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

crypto

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package crypto seals provider signing secrets at rest with AES-256-GCM.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoKey = errors.New("crypto: no secret key configured")

ErrNoKey indicates a secret operation was attempted without a configured key.

Functions

This section is empty.

Types

type Sealer

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

Sealer encrypts and decrypts secrets. A nil Sealer is valid and returns ErrNoKey from Seal/Open, so callers can construct one unconditionally and fail only when a secret is actually used.

func NewSealer

func NewSealer(passphrase string) (*Sealer, error)

NewSealer derives an AES-256 key from the passphrase. An empty passphrase yields a nil Sealer that rejects secret operations.

func (*Sealer) Open

func (s *Sealer) Open(sealed []byte) ([]byte, error)

Open reverses Seal.

func (*Sealer) Seal

func (s *Sealer) Seal(plaintext []byte) ([]byte, error)

Seal returns nonce||ciphertext for the plaintext.

Jump to

Keyboard shortcuts

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