secrets

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 9 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 keeps the secrets gitd stores on disk — the tokens and private keys of connections made through the API — sealed with a key kept apart, when one is given.

Without a key a secret is kept as it is, and only the file's permissions protect it. With one, a copy of the state directory or a backup of it opens nothing without the key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

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

Box seals and opens secrets with one key, or keeps them as they are without one.

func Open

func Open(keyFile string) (*Box, error)

Open returns the box for the key in keyFile, or a box without a key when keyFile is empty. The key is 32 bytes, written raw, in hex or in base64.

func (*Box) Seal

func (box *Box) Seal(secret []byte) (string, error)

Seal returns the secret as it is kept: sealed when the box has a key.

func (*Box) Unseal

func (box *Box) Unseal(kept string) ([]byte, error)

Unseal returns the secret a kept value holds. A value kept before a key was given opens as it is; a sealed one needs the key it was sealed with.

Jump to

Keyboard shortcuts

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