utils

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: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MrEnclaveLength = 32

Variables

This section is empty.

Functions

func ExtractEndpoint

func ExtractEndpoint(credentials *protos.Credentials) (string, error)

func ExtractMSPID

func ExtractMSPID(serializedIdentityRaw []byte) (string, error)

func GetChaincodeRequestMessageFromSignedProposal

func GetChaincodeRequestMessageFromSignedProposal(signedProposal *pb.SignedProposal) (crmProtoBytes []byte, e error)

func GetEnclaveId

func GetEnclaveId(attestedData *protos.AttestedData) string

GetEnclaveId 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 IsFPCCompositeKey(comp string) bool

func MarshalOrPanic

func MarshalOrPanic(pb proto.Message) []byte

func MarshallProto

func MarshallProto(msg proto.Message) ([]byte, error)

MarshallProto returns a serialized protobuf message

func MarshallProtoBase64

func MarshallProtoBase64(msg proto.Message) string

MarshallProtoBase64 returns a serialized protobuf message encoded as base64 string

func Read

func Read(file string) []byte

func SplitFPCCompositeKey

func SplitFPCCompositeKey(comp_str string) []string

func TransformToFPCKey

func TransformToFPCKey(comp string) string

func UnmarshalAttestedData

func UnmarshalAttestedData(serializedAttestedData *anypb.Any) (*protos.AttestedData, error)

func UnmarshalChaincodeResponseMessage

func UnmarshalChaincodeResponseMessage(data []byte) (*protos.ChaincodeResponseMessage, error)

func UnmarshalCredentials

func UnmarshalCredentials(credentialsBase64 string) (*protos.Credentials, error)

func UnmarshalInitEnclaveMessage

func UnmarshalInitEnclaveMessage(data []byte) (*protos.InitEnclaveMessage, error)

func UnmarshalQueryChaincodeDefinitionResult

func UnmarshalQueryChaincodeDefinitionResult(data []byte) (*lifecycle.QueryChaincodeDefinitionResult, error)

func UnmarshalSignedChaincodeResponseMessage

func UnmarshalSignedChaincodeResponseMessage(data []byte) (*protos.SignedChaincodeResponseMessage, error)

func ValidateEndpoint

func ValidateEndpoint(endpoint string) error

Types

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 IdentityEvaluatorInterface

type IdentityEvaluatorInterface interface {
	EvaluateCreatorIdentity(creatorIdentityBytes []byte, ownerMSP string) error
}

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