msp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalMSP

func GetLocalMSP() msp.MSP

GetLocalMSP returns the local msp (and creates it if it doesn't exist)

func GetSigningIdentity

func GetSigningIdentity() (msp.SigningIdentity, error)

GetSigningIdentity 获取bccsp类型的签名身份

func LoadLocalMspWithType

func LoadLocalMspWithType(dir string, bccspConfig *factory.FactoryOpts, mspID, mspType string) error

LoadLocalMspWithType loads the local MSP with the specified type from the specified directory

func NewBccspConf

func NewBccspConf() *factory.FactoryOpts

NewBccspConf 默认,暂时写死,也可以从配置文件中取

Types

type IdentitySerializer

type IdentitySerializer interface {
	// Serialize converts an identity to bytes
	Serialize() ([]byte, error)
}

IdentitySerializer serializes identities

type LocalSigner

type LocalSigner interface {
	SignatureHeaderMaker
	Signer
}

LocalSigner is a temporary stub interface which will be implemented by the local MSP

func NewSigner

func NewSigner() LocalSigner

NewSigner returns a new instance of the msp-based LocalSigner. It assumes that the local msp has been already initialized. Look at mspmgmt.LoadLocalMsp for further information.

func NewSigner() crypto.LocalSigner {
	return &mspSigner{}
}

type MspEnv

type MspEnv struct {
	MspID         string
	MspConfigPath string
	MspType       string //"bccsp", "idemix"  默认bccsp
}

MspEnv 组织信息

func (*MspEnv) InitCrypto

func (m *MspEnv) InitCrypto() (*factory.FactoryOpts, error)

InitCrypto initializes crypto for this peer

func (*MspEnv) Verify

func (m *MspEnv) Verify() error

type SignatureHeaderMaker

type SignatureHeaderMaker interface {
	// NewSignatureHeader creates a SignatureHeader with the correct signing identity and a valid nonce
	NewSignatureHeader() (*cb.SignatureHeader, error)
}

SignatureHeaderMaker creates a new SignatureHeader

type Signer

type Signer interface {
	// Sign a message and return the signature over the digest, or error on failure
	Sign(message []byte) ([]byte, error)
}

Signer signs messages

Jump to

Keyboard shortcuts

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