registry

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package registry implements the client-facing interface of ERCC. The corresponding specification can be found in the ERCC Interface section in `$FPC_PATH/docs/design/fabric-v2+/interfaces.md`

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Contract

type Contract struct {
	contractapi.Contract

	Verifier   attestation.VerifierInterface
	IEvaluator utils.IdentityEvaluatorInterface
}

func (*Contract) GetKeyExport

func (rs *Contract) GetKeyExport(ctx contractapi.TransactionContextInterface, chaincodeId, enclaveId string) (string, error)

GetKeyExport retrieve key export (Post-MVP feature)

func (*Contract) PutKeyExport

func (rs *Contract) PutKeyExport(ctx contractapi.TransactionContextInterface, exportMessageBase64 string) error

PutKeyExport register key export (Post-MVP feature)

func (*Contract) QueryChaincodeEncryptionKey

func (rs *Contract) QueryChaincodeEncryptionKey(ctx contractapi.TransactionContextInterface, chaincodeId string) (string, error)

QueryChaincodeEncryptionKey returns the chaincode encryption key for a given chaincode id

func (*Contract) QueryChaincodeEndPoints

func (rs *Contract) QueryChaincodeEndPoints(ctx contractapi.TransactionContextInterface, chaincodeId string) (string, error)

QueryChaincodeEndPoints returns the chaincode endpoints for given chaincode id (if more than one, they are concatenated with a ",")

func (*Contract) QueryEnclaveCredentials

func (rs *Contract) QueryEnclaveCredentials(ctx contractapi.TransactionContextInterface, chaincodeId string, enclaveId string) (string, error)

QueryEnclaveCredentials returns credentials for a provided chaincode and enclave id

func (*Contract) QueryListEnclaveCredentials

func (rs *Contract) QueryListEnclaveCredentials(ctx contractapi.TransactionContextInterface, chaincodeId string) ([]string, error)

QueryListEnclaveCredentials returns a set of credentials registered for a given chaincode id Note: to get the endpoints of FPC endorsing peers do the following: - discover all endorsing peers (and their endpoints) for the FPC chaincode using "normal" lifecycle - query `getEnclaveId` at all the peers discovered - query `queryListEnclaveCredentials` with all received enclave_ids this gives you the endpoints and credentials including enclave_vk, and chaincode_ek

Note that this implementation returns a set of (base64-encoded) protobuf-serialized `Credential` objects in order to send it to the receiver. That is, the receiver needs to deserialize the return value into []Credentials TODO look into custom serializer to make this call more aligned with the FPC API in `interfaces.md`

func (*Contract) QueryListProvisionedEnclaves

func (rs *Contract) QueryListProvisionedEnclaves(ctx contractapi.TransactionContextInterface, chaincodeId string) ([]string, error)

QueryListProvisionedEnclaves returns a list of enclave ids of all provisioned enclaves for a given chaincode id. A provisioned enclave is a registered enclave that has also the chaincode decryption key. Optional Post-MVP;

func (*Contract) RegisterCCKeys

func (rs *Contract) RegisterCCKeys(ctx contractapi.TransactionContextInterface, ccKeyRegistrationMessageBase64 string) error

RegisterCCKeys registers a CCKeyRegistration message that confirms that an enclave is provisioned with the chaincode encryption key. This method is used during the key generation and key distribution protocol. In particular, during key generation, this call sets the chaincode_ek for a chaincode if no chaincode_ek is set yet.

func (*Contract) RegisterEnclave

func (rs *Contract) RegisterEnclave(ctx contractapi.TransactionContextInterface, credentialsBase64 string) error

RegisterEnclave register a new FPC chaincode enclave instance

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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