timebox

package
v0.0.0-...-b4b3d51 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Timebox is a thin wrapper around nacl/secretbox for time-based secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(data []byte, key *[32]byte) ([]byte, bool)

Open is shorthand for calling OpenAt with time.Now as its first argument.

func OpenAt

func OpenAt(when time.Time, data []byte, key *[32]byte) (out []byte, ok bool)

OpenAt attempts to unseal the sealed data, returning false if the data has expired.

func Seal

func Seal(data []byte, expires time.Time, key *[32]byte) ([]byte, error)

Seal is shorthand for calling SealWith with a nonce read via rand.Read.

func SealWith

func SealWith(data []byte, expires time.Time, nonce *[24]byte, key *[32]byte) ([]byte, error)

SealWith encrypts data the time-sensitive using nacl/secretbox.

Types

This section is empty.

Jump to

Keyboard shortcuts

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