encryption

package
v0.0.0-...-f63b586 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: MIT Imports: 9 Imported by: 0

README

Hyperledger Fabric chaincode kit (CCKit)

Encryption extension

Allows to encrypt all data in ledger

Based on example

Documentation

Index

Constants

View Source
const TransientMapKey = `ENCODE_KEY`

Variables

View Source
var (
	// ErrKeyNotDefinedInTransientMap occurs when key not defined in transient map
	ErrKeyNotDefinedInTransientMap = errors.New(`key not defined in transient map`)
)

Functions

func ArgsDecryptIfKeyProvided

func ArgsDecryptIfKeyProvided(next router.ContextHandlerFunc, pos ...int) router.ContextHandlerFunc

func Decrypt

func Decrypt(key, value []byte) ([]byte, error)

Decrypt decrypts value with key

func DecryptArgs

func DecryptArgs(key []byte, args [][]byte) ([][]byte, error)

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 Encrypt

func Encrypt(key []byte, value interface{}) ([]byte, error)

Encrypt converts value to []byte and encrypts its with key

func EncryptArgs

func EncryptArgs(key []byte, args ...interface{}) ([][]byte, error)

EncryptArgs encrypt args

func EncryptBytesWith

func EncryptBytesWith(key []byte) state.ToBytesTransformer

EncryptBytesWith encrypts bytes with key - used for encrypting data for state

func KeyFromTransient

func KeyFromTransient(c router.Context) ([]byte, error)

KeyFromTransient gets key for encrypting/decrypting from transient map

func KeyPartsEncryptedWith

func KeyPartsEncryptedWith(encryptKey []byte) state.KeyPartsTransformer

KeyPartsEncryptedWith encrypts key parts

func State

func State(c router.Context, key []byte) (state.State, error)

State encrypting the data before putting to state and decrypting the data after getting from state

func StateWithTransientKey

func StateWithTransientKey(c router.Context) (state.State, error)

StateWithTransientKey creates encrypted state state with provided key for symmetric encryption/decryption

func TransientMapWithKey

func TransientMapWithKey(key []byte) map[string][]byte

TransientMapWithKey creates transient map with encrypting/decrypting key

Types

This section is empty.

Jump to

Keyboard shortcuts

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