Documentation ¶
Overview ¶
Package user_keys handles user management functions related to user keys.
Index ¶
- func ConvertAdminPathToPrivateKeyPath(adminPath []string) (keyPath []string, err error)
- func ConvertAdminPathToSymKeyPath(adminPath []string) (keyPath []string, err error)
- func GetUserKeys(stub cached_stub.CachedStubInterface, caller data_model.User, userId string, ...) (*data_model.Keys, error)
- func GetUserPrivateKey(stub cached_stub.CachedStubInterface, caller data_model.User, userId string, ...) (data_model.Key, error)
- func GetUserPublicKey(stub cached_stub.CachedStubInterface, caller data_model.User, userId string) (data_model.Key, error)
- func GetUserSymKey(stub cached_stub.CachedStubInterface, caller data_model.User, userId string, ...) (data_model.Key, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAdminPathToPrivateKeyPath ¶
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 ¶
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.