encrypteddb

package
v2.0.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbFn

type DbFn func(g *libkb.GlobalContext) *libkb.JSONLocalDb

type EncryptedDB

type EncryptedDB struct {
	libkb.Contextified
	// contains filtered or unexported fields
}

Handle to a db that encrypts values using nacl secretbox. Does not encrypt keys. Not threadsafe.

func New

func New(g *libkb.GlobalContext, getDB DbFn, getSecretBoxKey KeyFn) *EncryptedDB

func (*EncryptedDB) Delete added in v1.0.33

func (i *EncryptedDB) Delete(ctx context.Context, key libkb.DbKey) error

func (*EncryptedDB) Get

func (i *EncryptedDB) Get(ctx context.Context, key libkb.DbKey, res interface{}) (bool, error)

Get a value Decodes into res Returns (found, err). Res is valid only if (found && err == nil)

func (*EncryptedDB) Put

func (i *EncryptedDB) Put(ctx context.Context, key libkb.DbKey, data interface{}) error

type KeyFn

type KeyFn func(context.Context) ([32]byte, error)

Jump to

Keyboard shortcuts

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