secrets

package
v0.3.0-rc.55 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package secrets holds Beacon's master key (master.key in the data directory) and the sealing that the settings and the vault (package vault) build on: AES-256-GCM under keys derived with HKDF, each bound to its context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveAEAD

func DeriveAEAD(key []byte, domain string) (cipher.AEAD, error)

DeriveAEAD derives a domain-separated AES-256-GCM cipher from a 256-bit root key.

func DeriveKey

func DeriveKey(key []byte, domain string) ([]byte, error)

DeriveKey derives a domain-separated 256-bit key from a 256-bit root key.

func LoadOrCreateKey

func LoadOrCreateKey(path string) ([]byte, error)

LoadOrCreateKey loads the 256-bit master key from path, or creates it atomically with mode 0600 on first start.

func ReadKey

func ReadKey(path string) ([]byte, error)

ReadKey reads a 256-bit key from path, encoded as 64 hexadecimal digits.

func SealValue

func SealValue(a cipher.AEAD, plain []byte, context string) ([]byte, error)

SealValue encrypts plain with AES-256-GCM and binds context as additional authenticated data.

func UnsealValue

func UnsealValue(a cipher.AEAD, box []byte, context string) ([]byte, error)

UnsealValue decrypts box with AES-256-GCM and verifies context as additional authenticated data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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