Documentation
¶
Index ¶
- Constants
- Variables
- func ArgsDecrypt(next router.ContextHandlerFunc, pos ...int) router.ContextHandlerFunc
- func ArgsDecryptIfKeyProvided(next router.ContextHandlerFunc, pos ...int) router.ContextHandlerFunc
- func Decrypt(key, value []byte) ([]byte, error)
- func DecryptArgs(key []byte, args [][]byte) ([][]byte, error)
- func DecryptBytesWith(key []byte) state.FromBytesTransformer
- func Encrypt(key []byte, value interface{}) ([]byte, error)
- func EncryptArgs(key []byte, args ...interface{}) ([][]byte, error)
- func EncryptBytesWith(key []byte) state.ToBytesTransformer
- func KeyFromTransient(c router.Context) ([]byte, error)
- func KeyPartsEncryptedWith(encryptKey []byte) state.KeyPartsTransformer
- func NewEncryptOnDemandPaymentCC() *router.Chaincode
- func NewEncryptPaymentCC() *router.Chaincode
- func State(c router.Context, key []byte) (state.State, error)
- func StateWithTransientKey(c router.Context) (state.State, error)
- func StateWithTransientKeyIfProvided(c router.Context) (state.State, error)
- func TransientMapWithKey(key []byte) map[string][]byte
- type Payment
Constants ¶
const TransientMapKey = `ENCODE_KEY`
Variables ¶
var ( // ErrKeyNotDefinedInTransientMap occurs when key not defined in transient map ErrKeyNotDefinedInTransientMap = errors.New(`key not defined in transient map`) )
Functions ¶
func ArgsDecrypt ¶ added in v0.3.1
func ArgsDecrypt(next router.ContextHandlerFunc, pos ...int) router.ContextHandlerFunc
ArgsDecryptIfKeyProvided - pre middleware, decrypts chaincode method arguments, key must be provided in transient map
func ArgsDecryptIfKeyProvided ¶
func ArgsDecryptIfKeyProvided(next router.ContextHandlerFunc, pos ...int) router.ContextHandlerFunc
ArgsDecryptIfKeyProvided - pre middleware, decrypts chaincode method arguments if key provided in transient map
func DecryptArgs ¶
DecryptArgs decrypt args
func DecryptBytesWith ¶
func DecryptBytesWith(key []byte) state.FromBytesTransformer
DecryptBytesWith decrypts by with key - used for decrypting data after reading from state
func EncryptArgs ¶
EncryptArgs encrypt args
func EncryptBytesWith ¶
func EncryptBytesWith(key []byte) state.ToBytesTransformer
EncryptBytesWith encrypts bytes with key - used for encrypting data for state
func KeyFromTransient ¶
KeyFromTransient gets key for encrypting/decrypting from transient map
func KeyPartsEncryptedWith ¶
func KeyPartsEncryptedWith(encryptKey []byte) state.KeyPartsTransformer
KeyPartsEncryptedWith encrypts key parts
func NewEncryptOnDemandPaymentCC ¶ added in v0.3.1
Chaincode with encrypting data on demand (if encrypting key is provided in transient map)
func NewEncryptPaymentCC ¶ added in v0.3.1
Chaincode with required encrypting (encrypting key must be provided in transient map)
func State ¶
State encrypting the data before putting to state and decrypting the data after getting from state
func StateWithTransientKey ¶
StateWithTransientKey creates encrypted state state with provided key for symmetric encryption/decryption
func StateWithTransientKeyIfProvided ¶ added in v0.3.1
StateWithTransientKeyIfProvided creates encrypted state wrapper with provided key for symmetric encryption/decryption if key provided, otherwise - standard state wrapper without encryption
func TransientMapWithKey ¶
TransientMapWithKey creates transient map with encrypting/decrypting key