Documentation
¶
Overview ¶
Package key provides a persistence layer for user key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Click to show internal directories.
Click to hide internal directories.