fabric: github.com/hyperledger/fabric/peer/gossip Index | Files | Directories

package gossip

import "github.com/hyperledger/fabric/peer/gossip"

Index

Package Files

mcs.go sa.go

func NewSecurityAdvisor Uses

func NewSecurityAdvisor(deserializer mgmt.DeserializersManager) api.SecurityAdvisor

NewSecurityAdvisor creates a new instance of mspSecurityAdvisor that implements MessageCryptoService

type MSPMessageCryptoService Uses

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

MSPMessageCryptoService implements the MessageCryptoService interface using the peer MSPs (local and channel-related)

In order for the system to be secure it is vital to have the MSPs to be up-to-date. Channels' MSPs are updated via configuration transactions distributed by the ordering service.

A similar mechanism needs to be in place to update the local MSP, as well. This implementation assumes that these mechanisms are all in place and working.

func NewMCS Uses

func NewMCS(channelPolicyManagerGetter policies.ChannelPolicyManagerGetter, localSigner crypto.LocalSigner, deserializer mgmt.DeserializersManager) *MSPMessageCryptoService

NewMCS creates a new instance of MSPMessageCryptoService that implements MessageCryptoService. The method takes in input: 1. a policies.ChannelPolicyManagerGetter that gives access to the policy manager of a given channel via the Manager method. 2. an instance of crypto.LocalSigner 3. an identity deserializer manager

func (*MSPMessageCryptoService) Expiration Uses

func (s *MSPMessageCryptoService) Expiration(peerIdentity api.PeerIdentityType) (time.Time, error)

func (*MSPMessageCryptoService) GetPKIidOfCert Uses

func (s *MSPMessageCryptoService) GetPKIidOfCert(peerIdentity api.PeerIdentityType) common.PKIidType

GetPKIidOfCert returns the PKI-ID of a peer's identity If any error occurs, the method return nil The PKid of a peer is computed as the SHA2-256 of peerIdentity which is supposed to be the serialized version of MSP identity. This method does not validate peerIdentity. This validation is supposed to be done appropriately during the execution flow.

func (*MSPMessageCryptoService) Sign Uses

func (s *MSPMessageCryptoService) Sign(msg []byte) ([]byte, error)

Sign signs msg with this peer's signing key and outputs the signature if no error occurred.

func (*MSPMessageCryptoService) ValidateIdentity Uses

func (s *MSPMessageCryptoService) ValidateIdentity(peerIdentity api.PeerIdentityType) error

ValidateIdentity validates the identity of a remote peer. If the identity is invalid, revoked, expired it returns an error. Else, returns nil

func (*MSPMessageCryptoService) Verify Uses

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

Verify checks that signature is a valid signature of message under a peer's verification key. If the verification succeeded, Verify returns nil meaning no error occurred. If peerIdentity is nil, then the verification fails.

func (*MSPMessageCryptoService) VerifyBlock Uses

func (s *MSPMessageCryptoService) VerifyBlock(chainID common.ChainID, seqNum uint64, signedBlock []byte) error

VerifyBlock returns nil if the block is properly signed, and the claimed seqNum is the sequence number that the block's header contains. else returns error

func (*MSPMessageCryptoService) VerifyByChannel Uses

func (s *MSPMessageCryptoService) VerifyByChannel(chainID common.ChainID, peerIdentity api.PeerIdentityType, signature, message []byte) error

VerifyByChannel checks that signature is a valid signature of message under a peer's verification key, but also in the context of a specific channel. If the verification succeeded, Verify returns nil meaning no error occurred. If peerIdentity is nil, then the verification fails.

Directories

PathSynopsis
mocks

Package gossip imports 16 packages (graph) and is imported by 6 packages. Updated 2018-12-29. Refresh now. Tools for package owners.