github.com/lzy4123/fabric@v2.1.1+incompatible/core/handlers/validation/api/policies/policies.go (about) 1 /* 2 Copyright IBM Corp. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package validation 8 9 import ( 10 validation "github.com/hyperledger/fabric/core/handlers/validation/api" 11 "github.com/hyperledger/fabric/protoutil" 12 ) 13 14 // PolicyEvaluator evaluates policies 15 type PolicyEvaluator interface { 16 validation.Dependency 17 18 // Evaluate takes a set of SignedData and evaluates whether this set of signatures satisfies 19 // the policy with the given bytes 20 Evaluate(policyBytes []byte, signatureSet []*protoutil.SignedData) error 21 } 22 23 // SerializedPolicy defines a serialized policy 24 type SerializedPolicy interface { 25 validation.ContextDatum 26 27 // Bytes returns the bytes of the SerializedPolicy 28 Bytes() []byte 29 }