Documentation ¶
Index ¶
- type MessageCryptoService
- type MockCryptoService
- func (mcs *MockCryptoService) Expiration(peerIdentity PeerIdentity) (time.Time, error)
- func (*MockCryptoService) GetPKIidOfCert(peerIdentity PeerIdentity) common.PKIid
- func (*MockCryptoService) Sign(msg []byte) ([]byte, error)
- func (*MockCryptoService) ValidateIdentity(peerIdentity PeerIdentity) error
- func (*MockCryptoService) Verify(peerIdentity PeerIdentity, signature, message []byte) error
- func (*MockCryptoService) VerifyBlock(channelID common.ChannelID, seqNum uint64, block *pbcommon.Block) error
- func (*MockCryptoService) VerifyBlockAttestation(channelID common.ChannelID, block *pbcommon.Block) error
- func (*MockCryptoService) VerifyByChannel(common.ChannelID, PeerIdentity, []byte, []byte) error
- type MockSecurityAdvisor
- type OrgIdentity
- type PeerIdentity
- type PeerIdentityFilter
- type PeerIdentityInfo
- type PeerIdentityInfoSet
- type PeerSecureDialOpts
- type PeerSuspector
- type SecurityAdvisor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageCryptoService ¶
type MessageCryptoService interface { GetPKIidOfCert(peerIdentity PeerIdentity) common.PKIid VerifyBlock(channelID common.ChannelID, seqNum uint64, block *pbcommon.Block) error VerifyBlockAttestation(channelID common.ChannelID, block *pbcommon.Block) error Sign(message []byte) ([]byte, error) Verify(peerIdentity PeerIdentity, signature, message []byte) error VerifyByChannel(channelID common.ChannelID, peerIdentity PeerIdentity, signature, message []byte) error ValidateIdentity(peerIdentity PeerIdentity) error Expiration(peerIdentity PeerIdentity) (time.Time, error) }
type MockCryptoService ¶
type MockCryptoService struct {
MockSecurityAdvisor
}
func (*MockCryptoService) Expiration ¶
func (mcs *MockCryptoService) Expiration(peerIdentity PeerIdentity) (time.Time, error)
func (*MockCryptoService) GetPKIidOfCert ¶
func (*MockCryptoService) GetPKIidOfCert(peerIdentity PeerIdentity) common.PKIid
func (*MockCryptoService) ValidateIdentity ¶
func (*MockCryptoService) ValidateIdentity(peerIdentity PeerIdentity) error
func (*MockCryptoService) Verify ¶
func (*MockCryptoService) Verify(peerIdentity PeerIdentity, signature, message []byte) error
func (*MockCryptoService) VerifyBlock ¶
func (*MockCryptoService) VerifyBlockAttestation ¶
func (*MockCryptoService) VerifyByChannel ¶
func (*MockCryptoService) VerifyByChannel(common.ChannelID, PeerIdentity, []byte, []byte) error
type MockSecurityAdvisor ¶
func (*MockSecurityAdvisor) OrgByPeerIdentity ¶
func (msa *MockSecurityAdvisor) OrgByPeerIdentity(peerIdentity PeerIdentity) OrgIdentity
type OrgIdentity ¶
type OrgIdentity []byte
type PeerIdentity ¶
type PeerIdentity []byte
PeerIdentity 的计算方法如下所示:
- proto.Marshal(pbmsp.SerializedIdentity)
- 将第一步得到的值作为 PeerIdentity。
type PeerIdentityFilter ¶
type PeerIdentityFilter func(info PeerIdentityInfo) bool
PeerIdentityFilter 能被过滤出来的(返回值是 true)是需要被留下的,不能被过滤出来的都被舍弃了。
type PeerIdentityInfo ¶
type PeerIdentityInfo struct { PKIid common.PKIid Identity PeerIdentity Organization OrgIdentity }
type PeerIdentityInfoSet ¶
type PeerIdentityInfoSet []PeerIdentityInfo
func (PeerIdentityInfoSet) ByID ¶
func (piis PeerIdentityInfoSet) ByID() map[string]PeerIdentityInfo
ByID 整理 PeerIdentityInfoSet,得到:map<PKIid, PeerIdentityInfo>,PKIid 对应唯一的 peer。
func (PeerIdentityInfoSet) ByOrg ¶
func (piis PeerIdentityInfoSet) ByOrg() map[string]PeerIdentityInfoSet
ByOrg 整理 PeerIdentityInfoSet,得到:map<Organization, PeerIdentityInfoSet>, 之所以 map 的 value 是 PeerIdentityInfoSet,是因为同一个组织下可能有多个 peer。
func (PeerIdentityInfoSet) Filter ¶
func (piis PeerIdentityInfoSet) Filter(filter PeerIdentityFilter) PeerIdentityInfoSet
type PeerSecureDialOpts ¶
type PeerSecureDialOpts func() []grpc.DialOption
type PeerSuspector ¶
type PeerSuspector func(peerIdentity PeerIdentity) bool
PeerSuspector 返回具有给定身份的 peer 是否被怀疑已被撤销,或其 CA 是否已被撤销。
type SecurityAdvisor ¶
type SecurityAdvisor interface { // 根据提供的 PeerIdentity 返回 OrgIdentity。 OrgByPeerIdentity(PeerIdentity) OrgIdentity }
Click to show internal directories.
Click to hide internal directories.