api

package
v0.0.0-...-e3e94bd Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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) Sign

func (*MockCryptoService) Sign(msg []byte) ([]byte, error)

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) VerifyBlock(channelID common.ChannelID, seqNum uint64, block *pbcommon.Block) error

func (*MockCryptoService) VerifyBlockAttestation

func (*MockCryptoService) VerifyBlockAttestation(channelID common.ChannelID, block *pbcommon.Block) error

func (*MockCryptoService) VerifyByChannel

func (*MockCryptoService) VerifyByChannel(common.ChannelID, PeerIdentity, []byte, []byte) error

type MockSecurityAdvisor

type MockSecurityAdvisor struct {
	mock.Mock
}

func (*MockSecurityAdvisor) OrgByPeerIdentity

func (msa *MockSecurityAdvisor) OrgByPeerIdentity(peerIdentity PeerIdentity) OrgIdentity

type OrgIdentity

type OrgIdentity []byte

type PeerIdentity

type PeerIdentity []byte

PeerIdentity 的计算方法如下所示:

  1. proto.Marshal(pbmsp.SerializedIdentity)
  2. 将第一步得到的值作为 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

ByID 整理 PeerIdentityInfoSet,得到:map<PKIid, PeerIdentityInfo>,PKIid 对应唯一的 peer。

func (PeerIdentityInfoSet) ByOrg

ByOrg 整理 PeerIdentityInfoSet,得到:map<Organization, PeerIdentityInfoSet>, 之所以 map 的 value 是 PeerIdentityInfoSet,是因为同一个组织下可能有多个 peer。

func (PeerIdentityInfoSet) Filter

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
}

Jump to

Keyboard shortcuts

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