key

package
v3.0.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package key provides a persistence layer for user key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDAO

func NewDAO(o dao.DAO) dao.DAO

Types

type DAO

type DAO interface {
	SaveKey(key *encryption.Key) error
	GetKey(owner string, KeyID string) (*encryption.Key, error)
	ListKeys(owner string) ([]*encryption.Key, error)
	DeleteKey(owner string, keyID string) error
}

DAO is a protocol for user key storing

type UserKeyTool

type UserKeyTool interface {
	GetEncrypted(ctx context.Context, keyID string, data []byte) ([]byte, error)
	GetDecrypted(ctx context.Context, keyID string, data []byte) ([]byte, error)
}

UserKeyTool describes a tool that can encrypt/decrypt data based on user context

func GetUserKeyTool

func GetUserKeyTool(user string, pass []byte) UserKeyTool

GetUserKeyTool creates a keytool based on specified @user and @pass

func MasterKeyTool

func MasterKeyTool(ctx context.Context) (UserKeyTool, error)

MasterKeyTool creates the admin key tool

Directories

Path Synopsis
Package grpc is a simple encryption key persistence layer
Package grpc is a simple encryption key persistence layer

Jump to

Keyboard shortcuts

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