Documentation ¶
Index ¶
- Constants
- func ExtractEndpoint(credentials *protos.Credentials) (string, error)
- func ExtractMSPID(serializedIdentityRaw []byte) (string, error)
- func ExtractMrEnclave(ccDef *lifecycle.QueryChaincodeDefinitionResult) (string, error)
- func GetChaincodeDefinition(chaincodeId string, stub shim.ChaincodeStubInterface) (*lifecycle.QueryChaincodeDefinitionResult, error)
- func GetChaincodeRequestMessageFromSignedProposal(signedProposal *pb.SignedProposal) (crmProtoBytes []byte, e error)
- func GetEnclaveId(attestedData *protos.AttestedData) string
- func GetMrEnclave(chaincodeId string, stub shim.ChaincodeStubInterface) (string, error)
- func IsFPCCompositeKey(comp string) bool
- func MarshallProto(msg proto.Message) string
- func Read(file string) []byte
- func ReplayReadWrites(stub shim.ChaincodeStubInterface, fpcrwset *protos.FPCKVSet) (err error)
- func SplitFPCCompositeKey(comp_str string) []string
- func TransformToFPCKey(comp string) string
- func UnmarshalCredentials(credentialsBase64 string) (*protos.Credentials, error)
- func Validate(signedResponseMessage *protos.SignedChaincodeResponseMessage, ...) error
- func ValidateEndpoint(endpoint string) error
- type AttestationParams
- type IdentityEvaluator
- type IdentityEvaluatorInterface
- type PolicyEvaluator
- type PolicyEvaluatorInterface
- type Response
Constants ¶
View Source
const MrEnclaveLength = 32
View Source
const MrEnclaveStateKey = "MRENCLAVE"
Variables ¶
This section is empty.
Functions ¶
func ExtractEndpoint ¶
func ExtractEndpoint(credentials *protos.Credentials) (string, error)
func ExtractMSPID ¶
func ExtractMrEnclave ¶
func ExtractMrEnclave(ccDef *lifecycle.QueryChaincodeDefinitionResult) (string, error)
func GetChaincodeDefinition ¶
func GetChaincodeDefinition(chaincodeId string, stub shim.ChaincodeStubInterface) (*lifecycle.QueryChaincodeDefinitionResult, error)
func GetChaincodeRequestMessageFromSignedProposal ¶
func GetChaincodeRequestMessageFromSignedProposal(signedProposal *pb.SignedProposal) (crmProtoBytes []byte, e error)
func GetEnclaveId ¶
func GetEnclaveId(attestedData *protos.AttestedData) string
returns enclave_id as hex-encoded string of SHA256 hash over enclave_vk.
func GetMrEnclave ¶
func GetMrEnclave(chaincodeId string, stub shim.ChaincodeStubInterface) (string, error)
func IsFPCCompositeKey ¶
func MarshallProto ¶
func ReplayReadWrites ¶
func ReplayReadWrites(stub shim.ChaincodeStubInterface, fpcrwset *protos.FPCKVSet) (err error)
func SplitFPCCompositeKey ¶
func TransformToFPCKey ¶
func UnmarshalCredentials ¶
func UnmarshalCredentials(credentialsBase64 string) (*protos.Credentials, error)
func Validate ¶
func Validate(signedResponseMessage *protos.SignedChaincodeResponseMessage, attestedData *protos.AttestedData) error
func ValidateEndpoint ¶
Types ¶
type AttestationParams ¶
type AttestationParams struct {
Params []string `json:"params"`
}
TODO replace this with a proto? TBD
type IdentityEvaluator ¶
type IdentityEvaluator struct { }
func (*IdentityEvaluator) EvaluateCreatorIdentity ¶
func (id *IdentityEvaluator) EvaluateCreatorIdentity(creatorIdentityBytes []byte, ownerMSP string) error
EvaluateCreatorIdentity check that two identities have the same msp id. This function requires marshalled msp.SerializedIdentity as inputs.
type PolicyEvaluator ¶
type PolicyEvaluator struct { }
func (*PolicyEvaluator) EvaluateIdentity ¶
func (id *PolicyEvaluator) EvaluateIdentity(policyBytes []byte, identityBytes []byte) error
EvaluateIdentity checks that the provided identity is a valid endorser as specified in the endorsement policy This function requires a marshalled pb.ApplicationPolicy and a marshalled msp.SerializedIdentity as input.
type PolicyEvaluatorInterface ¶
type PolicyEvaluatorInterface interface {
EvaluateIdentity(policyBytes []byte, identityBytes []byte) error
}
func NewPolicyEvaluator ¶
func NewPolicyEvaluator() PolicyEvaluatorInterface
type Response ¶
type Response struct { ResponseData []byte `json:"ResponseData"` Signature []byte `json:"Signature"` PublicKey []byte `json:"PublicKey"` }
Response contains the response data and signature produced by the enclave TODO remove once ecc uses new ChaincodeResponseMessage
func UnmarshalResponse ¶
Click to show internal directories.
Click to hide internal directories.