sealrow

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 7 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 sealrow seals one record of komando's local store. A sealed row is

format (1 byte) | suite (1 byte) | nonce (12 bytes) | AES-256-GCM ciphertext

and the sealing is bound to the row's ID, type and version, so a row copied to another ID, type or version, or an older version put back in its place, does not open. The ID, type and version stay readable in their own columns; everything else, names included, is inside the seal.

The package holds no key and reads no file or environment: the caller passes the row key, which package sealkey makes from the store's master key.

Index

Constants

View Source
const Format byte = 1

Format is the row format this komando writes. A row with a higher number was written by a newer komando.

View Source
const (

	// KeyLen is the size of the row key.
	KeyLen = 32
)
View Source
const SuiteAESGCM byte = 1

SuiteAESGCM is AES-256-GCM under the row key, random 96-bit nonces.

Variables

View Source
var (
	// ErrNewerFormat: the row was written by a newer komando.
	ErrNewerFormat = errors.New("sealrow: row written by a newer komando; update komando")
	// ErrOpen: the row is damaged, was sealed with another key, or was moved
	// to another ID, type or version.
	ErrOpen = errors.New("sealrow: row does not open (wrong key, damaged, or moved)")
)

Functions

func NewID

func NewID() (string, error)

NewID returns a random 128-bit record ID as 32 hex characters. It says nothing about the record.

Types

type Key

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

Key seals and opens rows. It is safe for use by several goroutines.

func NewKey

func NewKey(rowKey []byte) (*Key, error)

NewKey makes a Key from the 32-byte row key (sealkey.Rows).

func (*Key) Open

func (k *Key) Open(r Row, sealed []byte) ([]byte, error)

Open returns the plain form of a row sealed by Seal for the same r.

func (*Key) Seal

func (k *Key) Seal(r Row, plain []byte) ([]byte, error)

Seal returns the sealed form of plain for row r.

type Row

type Row struct {
	ID      string
	Type    string
	Version uint64
}

Row names the readable columns the seal is bound to.

Jump to

Keyboard shortcuts

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