validatorlib

package
v0.0.0-...-f069fcf Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FABRIC_EVALUATOR = "fabric_evaluator"
)

Variables

This section is empty.

Functions

func ExtractValidationArtifacts

func ExtractValidationArtifacts(proof []byte) (*valiadationArtifacts, error)

func GetPolicyEnvelope

func GetPolicyEnvelope(policy string) ([]byte, error)

func GetSignatureSet

func GetSignatureSet(artifact *valiadationArtifacts) []*protoutil.SignedData

func New

func New() (*wasmer.Imports, error)

func PreCheck

func PreCheck(proof, payload []byte, cid string) (*valiadationArtifacts, error)

func UnmarshalPrivateKey

func UnmarshalPrivateKey(data []byte, opt AlgorithmOption) (crypto.PrivateKey, error)

func UnmarshalPublicKey

func UnmarshalPublicKey(data []byte, opt AlgorithmOption) (crypto.PublicKey, error)

func ValidateChainCodeID

func ValidateChainCodeID(prp []byte, name string) error

func ValidatePayload

func ValidatePayload(info payloadInfo, payloadByte []byte) error

func ValidateV14

func ValidateV14(proof, payload, policyBytes []byte, confByte []string, cid, from string) error

Types

type AlgorithmOption

type AlgorithmOption string
const (
	// Secp256r1 secp256r1 algorithm
	Secp256r1 AlgorithmOption = "Secp256r1"
)

type ECDSASignature

type ECDSASignature struct {
	R, S *big.Int
}

type Imports

type Imports struct {
	// contains filtered or unexported fields
}

type PolicyEvaluator

type PolicyEvaluator struct {
	msp.IdentityDeserializer
}

func NewPolicyEvaluator

func NewPolicyEvaluator(confBytes []string) (*PolicyEvaluator, error)

func (*PolicyEvaluator) Evaluate

func (id *PolicyEvaluator) Evaluate(policyBytes []byte, signatureSet []*protoutil.SignedData) error

type PrivateKey

type PrivateKey struct {
	K *ecdsa.PrivateKey
}

func (*PrivateKey) Bytes

func (priv *PrivateKey) Bytes() ([]byte, error)

Bytes returns a serialized, storable representation of this key

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey ECDSA public key. never new(PublicKey), use NewPublicKey()

func (*PublicKey) Bytes

func (pub *PublicKey) Bytes() ([]byte, error)

type ValidatorInfo

type ValidatorInfo struct {
	ChainId  string   `json:"chain_id"`
	ConfByte []string `json:"conf_byte"`
	Policy   string   `json:"policy"`
	Cid      string   `json:"cid"`
}

func UnmarshalValidatorInfo

func UnmarshalValidatorInfo(validatorBytes []byte) (*ValidatorInfo, error)

Jump to

Keyboard shortcuts

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