{"modulePath":"github.com/2lambda123/hyperledger-fabric","version":"v1.4.12","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\n## Constants\n\n```go\nconst DECKEY = \"DECKEY\"\n```\n\n```go\nconst ENCKEY = \"ENCKEY\"\n```\n\n```go\nconst IV = \"IV\"\n```\n\n```go\nconst SIGKEY = \"SIGKEY\"\n```\n\n```go\nconst VERKEY = \"VERKEY\"\n```\n\n## Types\n\n```go\ntype EncCC struct {\n\t// contains filtered or unexported fields\n}\n```\nEncCC example simple Chaincode implementation of a chaincode that uses encryption/signatures\n\n```go\nfunc (t *EncCC) Decrypter(stub shim.ChaincodeStubInterface, args []string, decKey, IV []byte) pb.Response\n```\nDecrypter exposes how to read from the ledger and decrypt using an AES 256 bit key that has been provided to the chaincode through the transient field.\n\n```go\nfunc (t *EncCC) DecrypterVerify(stub shim.ChaincodeStubInterface, args []string, decKey, verKey []byte) pb.Response\n```\nDecrypterVerify exposes how to get state to the ledger after having received keys for decrypting (AES 256 bit key) and verifying (X9.62/SECG curve over a 256 bit prime field) that has been provided to the chaincode through the transient field\n\n```go\nfunc (t *EncCC) Encrypter(stub shim.ChaincodeStubInterface, args []string, encKey, IV []byte) pb.Response\n```\nEncrypter exposes how to write state to the ledger after having encrypted it with an AES 256 bit key that has been provided to the chaincode through the transient field\n\n```go\nfunc (t *EncCC) EncrypterSigner(stub shim.ChaincodeStubInterface, args []string, encKey, sigKey []byte) pb.Response\n```\nEncrypterSigner exposes how to write state to the ledger after having received keys for encrypting (AES 256 bit key) and signing (X9.62/SECG curve over a 256 bit prime field) that has been provided to the chaincode through the transient field\n\n```go\nfunc (t *EncCC) Init(stub shim.ChaincodeStubInterface) pb.Response\n```\nInit does nothing for this cc\n\n```go\nfunc (t *EncCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response\n```\nInvoke for this chaincode exposes functions to ENCRYPT, DECRYPT transactional data.  It also supports an example to ENCRYPT and SIGN and DECRYPT and VERIFY.  The Initialization Vector (IV) can be passed in as a parm to ensure peers have deterministic data.\n\n```go\nfunc (t *EncCC) RangeDecrypter(stub shim.ChaincodeStubInterface, decKey []byte) pb.Response\n```\nRangeDecrypter shows how range queries may be satisfied by using the decrypter entity directly to decrypt previously encrypted key-value pairs\n\n","path":"github.com/2lambda123/hyperledger-fabric/examples/chaincode/go/enccc_example","name":"main","synopsis":"","isRedistributable":true}
