secrets

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package secrets is the end-to-end encryption of a workspace's secrets (ADR-0009, docs/architecture/security.md): age with X25519 keys.

  • The workspace has a key pair. Its public half (the recipient) is on the workspace server: anyone allowed to set a secret encrypts to it.
  • Every device has a key pair of its own. The workspace's private key reaches a device wrapped — encrypted — to the device's public key, by a device that holds it already (an admin's or a teamlead's agent), or from the recovery key.
  • The server keeps public keys, wrapped keys and ciphertexts: it reads no value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKey

func NewKey() (*age.X25519Identity, error)

NewKey makes a key pair: a workspace's or a device's.

func Open

func Open(sealed []byte, key *age.X25519Identity) ([]byte, error)

Open decrypts what Seal made for key.

func ParseKey

func ParseKey(s string) (*age.X25519Identity, error)

ParseKey reads a private key: AGE-SECRET-KEY-1…, the form of the recovery key too.

func Seal

func Seal(value []byte, publicKey string) ([]byte, error)

Seal encrypts a value to a public key (age1…).

func Unwrap

func Unwrap(wrapped []byte, device *age.X25519Identity) (*age.X25519Identity, error)

Unwrap opens a workspace key wrapped for this device.

func Wrap

func Wrap(workspaceKey *age.X25519Identity, devicePublic string) ([]byte, error)

Wrap encrypts a workspace key for a device.

Types

This section is empty.

Jump to

Keyboard shortcuts

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