server: Index | Files

package mixkey

import ""

Package mixkey provides persistent mix keys and associated utilities.


Package Files



const (

    // TagLength is the replay tag length in bytes.
    TagLength = sha512.Size256

    // KeyGlob is the pattern that matches the filenames for keys that have
    // been persisted to disk.
    KeyGlob = "mixkey-*.db"

    // KeyFmt is the format string corresponding to filenames for keys that
    // have been persisted to disk.
    KeyFmt = "mixkey-%d.db"

type MixKey Uses

type MixKey struct {
    // contains filtered or unexported fields

MixKey is a Katzenpost server mix key.

func New Uses

func New(dataDir string, epoch uint64) (*MixKey, error)

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

func (*MixKey) Deref Uses

func (k *MixKey) Deref()

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

func (*MixKey) Epoch Uses

func (k *MixKey) Epoch() uint64

Epoch returns the Katzenpost epoch associated with the keypair.

func (*MixKey) IsReplay Uses

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 Uses

func (k *MixKey) PrivateKey() *ecdh.PrivateKey

PrivateKey returns the private component of the key.

func (*MixKey) PublicKey Uses

func (k *MixKey) PublicKey() *ecdh.PublicKey

PublicKey returns the public component of the key.

func (*MixKey) Ref Uses

func (k *MixKey) Ref()

Ref increases the refcount by one.

func (*MixKey) SetUnlinkIfExpired Uses

func (k *MixKey) SetUnlinkIfExpired(b bool)

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

Package mixkey imports 15 packages (graph) and is imported by 3 packages. Updated 2020-05-20. Refresh now. Tools for package owners.