mixkey

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0, AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mixkey provides persistent mix keys and associated utilities.

Index

Constants

View Source
const (
	// TagLength is the replay tag length in bytes.
	TagLength = sha512.Size256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MixKey

type MixKey struct {
	sync.Mutex
	// contains filtered or unexported fields
}

MixKey is a Katzenpost server mix key.

func New

func New(epoch uint64, g *geo.Geometry) (*MixKey, error)

New creates (or loads) a mix key in the provided data directory, for the given epoch.

func (*MixKey) Deref

func (k *MixKey) Deref()

Deref reduces the refcount by one, and closes the key if the refcount hits 0.

func (*MixKey) Epoch

func (k *MixKey) Epoch() uint64

Epoch returns the Katzenpost epoch associated with the keypair.

func (*MixKey) IsReplay

func (k *MixKey) IsReplay(rawTag []byte) bool

IsReplay marks a given replay tag as seen, and returns true iff the tag has been seen previously (Test and Set).

func (*MixKey) PrivateKey

func (k *MixKey) PrivateKey() interface{}

PrivateKey returns the private component of the key.

func (*MixKey) PublicBytes

func (k *MixKey) PublicBytes() []byte

PublicBytes returns the public key in raw bytes.

func (*MixKey) PublicKey

func (k *MixKey) PublicKey() (nike.PublicKey, kem.PublicKey)

PublicKey returns the public component of the key.

func (*MixKey) Ref

func (k *MixKey) Ref()

Ref increases the refcount by one.

func (*MixKey) SetUnlinkIfExpired

func (k *MixKey) SetUnlinkIfExpired(b bool)

SetUnlinkIfExpired sets if the key will be deleted when closed if it is expired.

Jump to

Keyboard shortcuts

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