Documentation ¶
Index ¶
- Variables
- func DecodeBox(ctx context.Context, b []byte, getSecretBoxKey KeyFn, res interface{}) error
- func EncodeBox(ctx context.Context, data interface{}, getSecretBoxKey KeyFn) ([]byte, error)
- func GetSecretBoxKey(ctx context.Context, g *libkb.GlobalContext, reason libkb.EncryptionReason, ...) (fkey [32]byte, err error)
- func GetSecretBoxKeyWithUID(ctx context.Context, g *libkb.GlobalContext, uid keybase1.UID, ...) (fkey [32]byte, err error)
- type DbFn
- type EncryptedDB
- type EncryptedFile
- type KeyFn
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDecryptionFailed = errors.New("failed to decrypt item")
ErrDecryptionFailed is returned when an encrypteddb box fails to decrypt
Functions ¶
func GetSecretBoxKey ¶
func GetSecretBoxKey(ctx context.Context, g *libkb.GlobalContext, reason libkb.EncryptionReason, reasonStr string) (fkey [32]byte, err error)
func GetSecretBoxKeyWithUID ¶
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
type EncryptedFile ¶
type EncryptedFile struct { libkb.Contextified // contains filtered or unexported fields }
func NewFile ¶
func NewFile(g *libkb.GlobalContext, path string, getSecretBoxKey KeyFn) *EncryptedFile
Click to show internal directories.
Click to hide internal directories.