package
Version:
v0.0.0-...-b4b3d51
Opens a new window with list of versions in this module.
Published: Jun 13, 2017
License: BSD-3-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Timebox is a thin wrapper around nacl/secretbox for time-based secrets.
-
func Open(data []byte, key *[32]byte) ([]byte, bool)
-
func OpenAt(when time.Time, data []byte, key *[32]byte) (out []byte, ok bool)
-
func Seal(data []byte, expires time.Time, key *[32]byte) ([]byte, error)
-
func SealWith(data []byte, expires time.Time, nonce *[24]byte, key *[32]byte) ([]byte, error)
Open is shorthand for calling OpenAt with time.Now as its first argument.
OpenAt attempts to unseal the sealed data, returning false if the data has
expired.
Seal is shorthand for calling SealWith with a nonce read via rand.Read.
SealWith encrypts data the time-sensitive using nacl/secretbox.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.