gossip

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelConfigGetter

type ChannelConfigGetter func(cid string) channelconfig.Resources

type DeserializersManager

type DeserializersManager interface {
	// 接收 proto.Marshal(pbmsp.SerializedIdentity) 字节切片 raw,对 raw 进行反序列化,
	// 得到 pbmsp.SerializedIdentity。
	Deserialize(raw []byte) (*pbmsp.SerializedIdentity, error)

	// 返回本地 msp 的标识符。
	GetLocalMSPIdentifier() string

	// 返回本地身份反序列化器 msp.IdentityDeserializer。
	GetLocalDeserializer() msp.IdentityDeserializer

	// 返回一个映射:通道 id ==> 通道反序列化器
	GetChannelDeserializers() map[string]msp.IdentityDeserializer
}

func NewDeserializersManager

func NewDeserializersManager(localMSP msp.MSP) DeserializersManager

type Hasher

type Hasher interface {
	Hash(msg []byte, opts bccsp.HashOpts) (hash []byte, err error)
}

type MSPMessageCryptoService

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

func (*MSPMessageCryptoService) Expiration

func (mmcs *MSPMessageCryptoService) Expiration(peerIdentity api.PeerIdentity) (time.Time, error)

Expiration 返回身份证书的过期时间。

func (*MSPMessageCryptoService) GetPKIidOfCert

func (mmcs *MSPMessageCryptoService) GetPKIidOfCert(peerIdentity api.PeerIdentity) common.PKIid

GetPKIidOfCert 根据给定的 api.PeerIdentity 计算 common.PKIid。

func (*MSPMessageCryptoService) Sign

func (mmcs *MSPMessageCryptoService) Sign(message []byte) ([]byte, error)

func (*MSPMessageCryptoService) ValidateIdentity

func (mmcs *MSPMessageCryptoService) ValidateIdentity(peerIdentity api.PeerIdentity) error

ValidateIdentity 如果给定的 identity 是本地 msp 管理的,则利用本地 msp 对该身份进行验证,否则 遍历所有通道的 msp,检查该身份是否由这些 msp 管理的,是的话,则利用对应的 msp 对身份进行验证。

func (*MSPMessageCryptoService) Verify

func (mmcs *MSPMessageCryptoService) Verify(peerIdentity api.PeerIdentity, signature, message []byte) error

Verify 验证签名在指定 identity 下是否正确。

func (*MSPMessageCryptoService) VerifyBlock

func (mmcs *MSPMessageCryptoService) VerifyBlock(channelID common.ChannelID, seqNum uint64, block *pbcommon.Block) error

VerifyBlock 与 VerifyBlockAttestation 的验证逻辑很相似,只是多了一些基础的验证步骤。

func (*MSPMessageCryptoService) VerifyBlockAttestation

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

VerifyBlockAttestation 验证区块中元数据里签名的合法性。

func (*MSPMessageCryptoService) VerifyByChannel

func (mmcs *MSPMessageCryptoService) VerifyByChannel(channelID common.ChannelID, peerIdentity api.PeerIdentity, signature, message []byte) error

Jump to

Keyboard shortcuts

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