msp

package
v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound indicates the user was not found
	ErrUserNotFound = errors.New("user not found")
)

Functions

This section is empty.

Types

type CAConfig

type CAConfig struct {
	URL              string
	Registrar        EnrollCredentials
	CAName           string
	TLSCAServerCerts [][]byte
	TLSCAClientCert  []byte
	TLSCAClientKey   []byte
}

CAConfig defines a CA configuration

type CCType

type CCType struct {
	Path string
}

CCType defines the path to crypto keys and certs

type ClientConfig

type ClientConfig struct {
	Organization    string
	Logging         logApi.LoggingType
	CryptoConfig    CCType
	TLSKey          []byte
	TLSCert         []byte
	CredentialStore CredentialStoreType
}

ClientConfig provides the definition of the client configuration

type Context

type Context interface {
	core.Providers
	Providers
}

Context is the context required by MSP services

type CredentialStoreType

type CredentialStoreType struct {
	Path        string
	CryptoStore struct {
		Path string
	}
}

CredentialStoreType defines pluggable KV store properties

type EnrollCredentials

type EnrollCredentials struct {
	EnrollID     string
	EnrollSecret string
}

EnrollCredentials holds credentials used for enrollment

type Identity

type Identity interface {

	// Identifier returns the identifier of that identity
	Identifier() *IdentityIdentifier

	// Verify a signature over some message using this identity as reference
	Verify(msg []byte, sig []byte) error

	// Serialize converts an identity to bytes
	Serialize() ([]byte, error)

	// EnrollmentCertificate Returns the underlying ECert representing this user’s identity.
	EnrollmentCertificate() []byte
}

Identity represents a Fabric client identity

type IdentityConfig

type IdentityConfig interface {
	Client() *ClientConfig
	CAConfig(org string) (*CAConfig, bool)
	CAServerCerts(org string) ([][]byte, bool)
	CAClientKey(org string) ([]byte, bool)
	CAClientCert(org string) ([]byte, bool)
	CAKeyStorePath() string
	CredentialStorePath() string
}

IdentityConfig contains identity configurations

type IdentityIdentifier

type IdentityIdentifier struct {

	// The identifier of the associated membership service provider
	MSPID string

	// The identifier for an identity within a provider
	ID string
}

IdentityIdentifier is a holder for the identifier of a specific identity, naturally namespaced, by its provider identifier.

type IdentityManager

type IdentityManager interface {
	GetSigningIdentity(name string) (SigningIdentity, error)
}

IdentityManager provides management of identities in Fabric network

type IdentityManagerProvider

type IdentityManagerProvider interface {
	IdentityManager(orgName string) (IdentityManager, bool)
}

IdentityManagerProvider provides identity management services

type PrivKeyKey

type PrivKeyKey struct {
	ID    string
	MSPID string
	SKI   []byte
}

PrivKeyKey is a composite key for accessing a private key in the key store

type Providers

type Providers interface {
	UserStore() UserStore
	IdentityManagerProvider
	IdentityConfig() IdentityConfig
}

Providers represents a provider of MSP service.

type SigningIdentity

type SigningIdentity interface {

	// Extends Identity
	Identity

	// Sign the message
	Sign(msg []byte) ([]byte, error)

	// GetPublicVersion returns the public parts of this identity
	PublicVersion() Identity

	// PrivateKey returns the crypto suite representation of the private key
	PrivateKey() core.Key
}

SigningIdentity is an extension of Identity to cover signing capabilities.

type UserData

type UserData struct {
	ID                    string
	MSPID                 string
	EnrollmentCertificate []byte
}

UserData is the representation of User in UserStore PrivateKey is stored separately, in the crypto store

type UserStore

type UserStore interface {
	Store(*UserData) error
	Load(IdentityIdentifier) (*UserData, error)
}

UserStore is responsible for UserData persistence

Jump to

Keyboard shortcuts

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