fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/common/providers/msp Index | Files

package msp

import "github.com/hyperledger/fabric-sdk-go/pkg/common/providers/msp"

Index

Package Files

identity.go provider.go store.go

Variables

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

type CAConfig Uses

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

CAConfig defines a CA configuration

type CCType Uses

type CCType struct {
    Path string
}

CCType defines the path to crypto keys and certs

type ClientConfig Uses

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 Uses

type Context interface {
    core.Providers
    Providers
}

Context is the context required by MSP services

type CredentialStoreType Uses

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

CredentialStoreType defines pluggable KV store properties

type EnrollCredentials Uses

type EnrollCredentials struct {
    EnrollID     string
    EnrollSecret string
}

EnrollCredentials holds credentials used for enrollment

type Identity Uses

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 Uses

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

IdentityConfig contains identity configurations

type IdentityIdentifier Uses

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 Uses

type IdentityManager interface {
    GetSigningIdentity(name string) (SigningIdentity, error)
    CreateSigningIdentity(ops ...SigningIdentityOption) (SigningIdentity, error)
}

IdentityManager provides management of identities in Fabric network

type IdentityManagerProvider Uses

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

IdentityManagerProvider provides identity management services

type IdentityOption Uses

type IdentityOption struct {
    Cert       []byte
    PrivateKey []byte
}

IdentityOption captures options used for creating a new SigningIdentity instance

type PrivKeyKey Uses

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 Uses

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

Providers represents a provider of MSP service.

type SigningIdentity Uses

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 SigningIdentityOption Uses

type SigningIdentityOption func(*IdentityOption) error

SigningIdentityOption describes a functional parameter for creating a new SigningIdentity instance

func WithCert Uses

func WithCert(cert []byte) SigningIdentityOption

WithCert can be passed as an option when creating a new SigningIdentity. When used alone, SDK will lookup the corresponding private key.

func WithPrivateKey Uses

func WithPrivateKey(key []byte) SigningIdentityOption

WithPrivateKey can be passed as an option when creating a new SigningIdentity. It cannot be used without the WithCert option

type UserData Uses

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 Uses

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

UserStore is responsible for UserData persistence

Package msp imports 3 packages (graph) and is imported by 24 packages. Updated 2019-08-08. Refresh now. Tools for package owners.