user_keys

package
v0.0.0-...-aeb4a1d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package user_keys handles user management functions related to user keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAdminPathToPrivateKeyPath

func ConvertAdminPathToPrivateKeyPath(adminPath []string) (keyPath []string, err error)

ConvertAdminPathToPrivateKeyPath is a convenience function that returns a keyPath to a user's private key given an admin path. KeyPath can be passed to AssetManger's GetAssetKey function.

func ConvertAdminPathToSymKeyPath

func ConvertAdminPathToSymKeyPath(adminPath []string) (keyPath []string, err error)

ConvertAdminPathToSymKeyPath is a convenience function that returns a keyPath to a user's sym key given an admin path. KeyPath can be passed to AssetManger's GetAssetKey function.

func GetUserKeys

func GetUserKeys(stub cached_stub.CachedStubInterface, caller data_model.User, userId string, keyPaths ...[]string) (*data_model.Keys, error)

GetUserKeys returns a user's private, public, and sym keys. Caller must have access to the user's private key. keyPaths are optional parameters. If passed in, the first keyPath is used for getting the private key, and the second keyPath is for getting the symkey. If only one keyPath is passed in, it is for the private key, and the sym key is obtained from the private key.

func GetUserPrivateKey

func GetUserPrivateKey(stub cached_stub.CachedStubInterface, caller data_model.User, userId string, keyPath ...[]string) (data_model.Key, error)

GetUserPrivateKey returns a user's private key. Caller must have access to the user's private key. keyPath is an optional parameter; if passed in, this keyPath is used to get the privateKey. If not, a default key path will be used. Default keyPath = [caller privkey, user privhashkey, user privkey]

func GetUserPublicKey

func GetUserPublicKey(stub cached_stub.CachedStubInterface, caller data_model.User, userId string) (data_model.Key, error)

GetUserPublicKey returns the public key for a given userId. If a caller already has the user object, call the GetPublicKey(user) function instead.

func GetUserSymKey

func GetUserSymKey(stub cached_stub.CachedStubInterface, caller data_model.User, userId string, keyPath ...[]string) (data_model.Key, error)

GetUserSymKey returns a user's sym key. Caller must have access to the user's private key. keyPath is an optional parameter; if passed in, this keyPath is used to get the symKey. If not, a default key path will be used. Default keyPath = [caller privkey, user symKey]

Types

This section is empty.

Jump to

Keyboard shortcuts

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