msp

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	IdemixConfigDirMsp                  = "msp"
	IdemixConfigDirUser                 = "user"
	IdemixConfigFileIssuerPublicKey     = "IssuerPublicKey"
	IdemixConfigFileRevocationPublicKey = "RevocationPublicKey"
	IdemixConfigFileSigner              = "SignerConfig"
)
View Source
const (
	MSPv1_0 = iota
	MSPv1_1
	MSPv1_3
	MSPv1_4_2
)
View Source
const (
	AttributeIndexOU = iota

	AttributeIndexRole

	AttributeIndexEnrollmentId

	AttributeIndexRevocationHandle
)
View Source
const (
	AttributeNameOU = "OU"

	AttributeNameRole = "Role"

	AttributeNameEnrollmentId = "EnrollmentID"

	AttributeNameRevocationHandle = "RevocationHandle"
)

Variables

Functions

func GetIdemixMspConfig

func GetIdemixMspConfig(dir string, ID string) (*msp.MSPConfig, error)

func GetLocalMspConfig

func GetLocalMspConfig(dir string, bccspConfig *factory.FactoryOpts, ID string) (*msp.MSPConfig, error)

func GetLocalMspConfigWithType

func GetLocalMspConfigWithType(dir string, bccspConfig *factory.FactoryOpts, ID, mspType string) (*msp.MSPConfig, error)

func GetRoleMaskFromIdemixRole

func GetRoleMaskFromIdemixRole(role Role) int

func GetVerifyingMspConfig

func GetVerifyingMspConfig(dir, ID, mspType string) (*msp.MSPConfig, error)

func NewSerializedIdentity

func NewSerializedIdentity(mspID string, certPEM []byte) ([]byte, error)

func ProviderTypeToString

func ProviderTypeToString(id ProviderType) string

func SetupBCCSPKeystoreConfig

func SetupBCCSPKeystoreConfig(bccspConfig *factory.FactoryOpts, keystoreDir string) *factory.FactoryOpts

Types

type BCCSPNewOpts

type BCCSPNewOpts struct {
	NewBaseOpts
}

type Configuration

type Configuration struct {
	OrganizationalUnitIdentifiers []*OrganizationalUnitIdentifiersConfiguration `yaml:"OrganizationalUnitIdentifiers,omitempty"`

	NodeOUs *NodeOUs `yaml:"NodeOUs,omitempty"`
}

type IdemixNewOpts

type IdemixNewOpts struct {
	NewBaseOpts
}

type Identity

type Identity interface {
	ExpiresAt() time.Time

	GetIdentifier() *IdentityIdentifier

	GetMSPIdentifier() string

	Validate() error

	GetOrganizationalUnits() []*OUIdentifier

	Anonymous() bool

	Verify(msg []byte, sig []byte) error

	Serialize() ([]byte, error)

	SatisfiesPrincipal(principal *msp.MSPPrincipal) error
}

type IdentityDeserializer

type IdentityDeserializer interface {
	DeserializeIdentity(serializedIdentity []byte) (Identity, error)

	IsWellFormed(identity *msp.SerializedIdentity) error
}

type IdentityIdentifier

type IdentityIdentifier struct {
	Mspid string

	Id string
}

type MSP

type MSP interface {
	IdentityDeserializer

	Setup(config *msp.MSPConfig) error

	GetVersion() MSPVersion

	GetType() ProviderType

	GetIdentifier() (string, error)

	GetSigningIdentity(identifier *IdentityIdentifier) (SigningIdentity, error)

	GetDefaultSigningIdentity() (SigningIdentity, error)

	GetTLSRootCerts() [][]byte

	GetTLSIntermediateCerts() [][]byte

	Validate(id Identity) error

	SatisfiesPrincipal(id Identity, principal *msp.MSPPrincipal) error
}

func New

func New(opts NewOpts, cryptoProvider bccsp.BCCSP) (MSP, error)

func NewBccspMspWithKeyStore

func NewBccspMspWithKeyStore(version MSPVersion, keyStore bccsp.KeyStore, bccsp bccsp.BCCSP) (MSP, error)

type MSPManager

type MSPManager interface {
	IdentityDeserializer

	Setup(msps []MSP) error

	GetMSPs() (map[string]MSP, error)
}

func NewMSPManager

func NewMSPManager() MSPManager

type MSPVersion

type MSPVersion int

type NewBaseOpts

type NewBaseOpts struct {
	Version MSPVersion
}

func (*NewBaseOpts) GetVersion

func (o *NewBaseOpts) GetVersion() MSPVersion

type NewOpts

type NewOpts interface {
	GetVersion() MSPVersion
}

type NodeOUs

type NodeOUs struct {
	Enable bool `yaml:"Enable,omitempty"`

	ClientOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"ClientOUIdentifier,omitempty"`

	PeerOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"PeerOUIdentifier,omitempty"`

	AdminOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"AdminOUIdentifier,omitempty"`

	OrdererOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"OrdererOUIdentifier,omitempty"`
}

type OUIdentifier

type OUIdentifier struct {
	CertifiersIdentifier []byte

	OrganizationalUnitIdentifier string
}

type OrganizationalUnitIdentifiersConfiguration

type OrganizationalUnitIdentifiersConfiguration struct {
	Certificate string `yaml:"Certificate,omitempty"`

	OrganizationalUnitIdentifier string `yaml:"OrganizationalUnitIdentifier,omitempty"`
}

type ProviderType

type ProviderType int
const (
	FABRIC ProviderType = iota
	IDEMIX
	OTHER
)

type Role

type Role int32
const (
	MEMBER Role = 1
	ADMIN  Role = 2
	CLIENT Role = 4
	PEER   Role = 8
)

type SigningIdentity

type SigningIdentity interface {
	Identity

	Sign(msg []byte) ([]byte, error)

	GetPublicVersion() Identity
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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