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

package msp

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


Package Files

caclient.go certfileuserstore.go fabcaadapter.go filecertstore.go filekeystore.go getsigid.go identityconfig.go identitymgr.go memory_key_store.go memory_user_store.go opts.go user.go

func BuildIdentityConfigFromOptions Uses

func BuildIdentityConfigFromOptions(opts ...interface{}) (msp.IdentityConfig, error)

BuildIdentityConfigFromOptions will return an IdentityConfig instance pre-built with Optional interfaces provided in fabsdk's WithConfigIdentity(opts...) call

func ConfigFromBackend Uses

func ConfigFromBackend(coreBackend ...core.ConfigBackend) (msp.IdentityConfig, error)

ConfigFromBackend returns identity config implementation of given backend

func IsIdentityConfigFullyOverridden Uses

func IsIdentityConfigFullyOverridden(c *IdentityConfigOptions) bool

IsIdentityConfigFullyOverridden will return true if all of the argument's sub interfaces is not nil (ie IdentityConfig interface not fully overridden)

func NewFileCertStore Uses

func NewFileCertStore(cryptoConfigMSPPath string) (core.KVStore, error)

NewFileCertStore ...

func NewFileKeyStore Uses

func NewFileKeyStore(cryptoConfigMSPPath string) (core.KVStore, error)

NewFileKeyStore loads keys stored in the cryptoconfig directory layout. This function will detect if private keys are stored in v1 or v2 format.

func UpdateMissingOptsWithDefaultConfig Uses

func UpdateMissingOptsWithDefaultConfig(c *IdentityConfigOptions, d msp.IdentityConfig) msp.IdentityConfig

UpdateMissingOptsWithDefaultConfig will verify if any functions of the IdentityConfig were not updated with fabsdk's WithConfigIdentity(opts...) call, then use default IdentityConfig interface for these functions instead

type CAClientImpl Uses

type CAClientImpl struct {
    // contains filtered or unexported fields

CAClientImpl implements api/msp/CAClient

func NewCAClient Uses

func NewCAClient(orgName string, ctx contextApi.Client, opts ...CAClientOption) (*CAClientImpl, error)

NewCAClient creates a new CA CAClient instance

func (*CAClientImpl) AddAffiliation Uses

func (c *CAClientImpl) AddAffiliation(request *api.AffiliationRequest) (*api.AffiliationResponse, error)

AddAffiliation adds a new affiliation to the server

func (*CAClientImpl) CreateIdentity Uses

func (c *CAClientImpl) CreateIdentity(request *api.IdentityRequest) (*api.IdentityResponse, error)

CreateIdentity create a new identity with the Fabric CA server. An enrollment secret is returned which can then be used, along with the enrollment ID, to enroll a new identity.

request holds info about identity

Return identity info including secret

func (*CAClientImpl) Enroll Uses

func (c *CAClientImpl) Enroll(request *api.EnrollmentRequest) error

Enroll a registered user in order to receive a signed X509 certificate. A new key pair is generated for the user. The private key and the enrollment certificate issued by the CA are stored in SDK stores. They can be retrieved by calling IdentityManager.GetSigningIdentity().

enrollmentID The registered ID to use for enrollment enrollmentSecret The secret associated with the enrollment ID

func (*CAClientImpl) GetAffiliation Uses

func (c *CAClientImpl) GetAffiliation(affiliation, caname string) (*api.AffiliationResponse, error)

GetAffiliation returns information about the requested affiliation

func (*CAClientImpl) GetAllAffiliations Uses

func (c *CAClientImpl) GetAllAffiliations(caname string) (*api.AffiliationResponse, error)

GetAllAffiliations returns all affiliations that the caller is authorized to see

func (*CAClientImpl) GetAllIdentities Uses

func (c *CAClientImpl) GetAllIdentities(caname string) ([]*api.IdentityResponse, error)

GetAllIdentities returns all identities that the caller is authorized to see

Response containing identities

func (*CAClientImpl) GetCAInfo Uses

func (c *CAClientImpl) GetCAInfo() (*api.GetCAInfoResponse, error)

GetCAInfo returns generic CA information

func (*CAClientImpl) GetIdentity Uses

func (c *CAClientImpl) GetIdentity(id, caname string) (*api.IdentityResponse, error)

GetIdentity retrieves identity information.

id is required identity id

Returns identity information

func (*CAClientImpl) ModifyAffiliation Uses

func (c *CAClientImpl) ModifyAffiliation(request *api.ModifyAffiliationRequest) (*api.AffiliationResponse, error)

ModifyAffiliation renames an existing affiliation on the server

func (*CAClientImpl) ModifyIdentity Uses

func (c *CAClientImpl) ModifyIdentity(request *api.IdentityRequest) (*api.IdentityResponse, error)

ModifyIdentity modifies identity with the Fabric CA server.

request holds info about identity

Return modified identity info

func (*CAClientImpl) Reenroll Uses

func (c *CAClientImpl) Reenroll(request *api.ReenrollmentRequest) error

Reenroll an enrolled user in order to obtain a new signed X509 certificate

func (*CAClientImpl) Register Uses

func (c *CAClientImpl) Register(request *api.RegistrationRequest) (string, error)

Register a User with the Fabric CA request: Registration Request Returns Enrolment Secret

func (*CAClientImpl) RemoveAffiliation Uses

func (c *CAClientImpl) RemoveAffiliation(request *api.AffiliationRequest) (*api.AffiliationResponse, error)

RemoveAffiliation removes an existing affiliation from the server

func (*CAClientImpl) RemoveIdentity Uses

func (c *CAClientImpl) RemoveIdentity(request *api.RemoveIdentityRequest) (*api.IdentityResponse, error)

RemoveIdentity removes identity from the Fabric CA server.

request holds info about identity to be removed

Return removed identity info

func (*CAClientImpl) Revoke Uses

func (c *CAClientImpl) Revoke(request *api.RevocationRequest) (*api.RevocationResponse, error)

Revoke a User with the Fabric CA registrar: The User that is initiating the revocation request: Revocation Request

type CAClientOption Uses

type CAClientOption func(*caClientOption) error

CAClientOption describes a functional parameter for NewCAClient

func WithCAInstance Uses

func WithCAInstance(caID string) CAClientOption

WithCAInstance allows for specifying optional CA name (within the CA server instance)

type CAConfig Uses

type CAConfig struct {
    ID          string
    URL         string
    GRPCOptions map[string]interface{}
    TLSCACerts  endpoint.MutualTLSConfig
    Registrar   msp.EnrollCredentials
    CAName      string

CAConfig defines a CA configuration in identity config

type CertFileUserStore Uses

type CertFileUserStore struct {
    // contains filtered or unexported fields

CertFileUserStore stores each user in a separate file. Only user's enrollment cert is stored, in pem format. File naming is <user>@<org>-cert.pem

func NewCertFileUserStore Uses

func NewCertFileUserStore(path string) (*CertFileUserStore, error)

NewCertFileUserStore creates a new instance of CertFileUserStore

func NewCertFileUserStore1 Uses

func NewCertFileUserStore1(store core.KVStore) (*CertFileUserStore, error)

NewCertFileUserStore1 creates a new instance of CertFileUserStore

func (*CertFileUserStore) Delete Uses

func (s *CertFileUserStore) Delete(key msp.IdentityIdentifier) error

Delete deletes a User from store

func (*CertFileUserStore) Load Uses

func (s *CertFileUserStore) Load(key msp.IdentityIdentifier) (*msp.UserData, error)

Load returns the User stored in the store for a key.

func (*CertFileUserStore) Store Uses

func (s *CertFileUserStore) Store(user *msp.UserData) error

Store stores a User into store

type ClientConfig Uses

type ClientConfig struct {
    Organization    string
    Logging         logApi.LoggingType
    CryptoConfig    msp.CCType
    TLSCerts        ClientTLSConfig
    CredentialStore msp.CredentialStoreType

ClientConfig defines client configuration in identity config

type ClientTLSConfig Uses

type ClientTLSConfig struct {
    //Client TLS information
    Client         endpoint.TLSKeyPair
    SystemCertPool bool

ClientTLSConfig defines client TLS configuration in identity config

type IdentityConfig Uses

type IdentityConfig struct {
    // contains filtered or unexported fields

IdentityConfig represents the identity configuration for the client

func (*IdentityConfig) CAClientCert Uses

func (c *IdentityConfig) CAClientCert(caID string) ([]byte, bool)

CAClientCert read configuration for the fabric CA client cert bytes for given org

func (*IdentityConfig) CAClientKey Uses

func (c *IdentityConfig) CAClientKey(caID string) ([]byte, bool)

CAClientKey read configuration for the fabric CA client key bytes for given org

func (*IdentityConfig) CAConfig Uses

func (c *IdentityConfig) CAConfig(caID string) (*msp.CAConfig, bool)

CAConfig returns the CA configuration.

func (*IdentityConfig) CAKeyStorePath Uses

func (c *IdentityConfig) CAKeyStorePath() string

CAKeyStorePath returns the same path as KeyStorePath() without the 'keystore' directory added. This is done because the fabric-ca-client adds this to the path

func (*IdentityConfig) CAServerCerts Uses

func (c *IdentityConfig) CAServerCerts(caID string) ([][]byte, bool)

CAServerCerts Read configuration option for the server certificates will send a list of cert bytes for given org

func (*IdentityConfig) Client Uses

func (c *IdentityConfig) Client() *msp.ClientConfig

Client returns the Client config

func (*IdentityConfig) CredentialStorePath Uses

func (c *IdentityConfig) CredentialStorePath() string

CredentialStorePath returns the user store path

func (*IdentityConfig) TLSCACertPool Uses

func (c *IdentityConfig) TLSCACertPool() commtls.CertPool

TLSCACertPool returns the configured cert pool.

type IdentityConfigOptions Uses

type IdentityConfigOptions struct {
    // contains filtered or unexported fields

IdentityConfigOptions represents IdentityConfig interface with overridable interface functions if a function is not overridden, the default IdentityConfig implementation will be used.

type IdentityManager Uses

type IdentityManager struct {
    // contains filtered or unexported fields

IdentityManager implements fab/IdentityManager

func NewIdentityManager Uses

func NewIdentityManager(orgName string, userStore msp.UserStore, cryptoSuite core.CryptoSuite, endpointConfig fab.EndpointConfig) (*IdentityManager, error)

NewIdentityManager creates a new instance of IdentityManager

func (*IdentityManager) CreateSigningIdentity Uses

func (mgr *IdentityManager) CreateSigningIdentity(opts ...msp.SigningIdentityOption) (msp.SigningIdentity, error)

CreateSigningIdentity creates a signing identity with the given options

func (*IdentityManager) GetSigningIdentity Uses

func (mgr *IdentityManager) GetSigningIdentity(id string) (msp.SigningIdentity, error)

GetSigningIdentity returns a signing identity for the given id

func (*IdentityManager) GetUser Uses

func (mgr *IdentityManager) GetUser(username string) (*User, error)

GetUser returns a user for the given user name

func (*IdentityManager) NewUser Uses

func (mgr *IdentityManager) NewUser(userData *msp.UserData) (*User, error)

NewUser creates a User instance

type MatchConfig Uses

type MatchConfig struct {
    Pattern string

    // these are used for hostname mapping
    URLSubstitutionExp                  string
    SSLTargetOverrideURLSubstitutionExp string
    MappedHost                          string

    // this is used for Name mapping instead of hostname mappings
    MappedName string

    //IgnoreEndpoint option to exclude given entity from any kind of search or from entity list
    IgnoreEndpoint bool

MatchConfig contains match pattern and substitution pattern for pattern matching of network configured hostnames or channel names with static config

type MemoryKeyStore Uses

type MemoryKeyStore struct {
    // contains filtered or unexported fields

MemoryKeyStore is in-memory implementation of BCCSP key store

func NewMemoryKeyStore Uses

func NewMemoryKeyStore(password []byte) *MemoryKeyStore

NewMemoryKeyStore creates a new MemoryKeyStore instance

func (*MemoryKeyStore) GetKey Uses

func (s *MemoryKeyStore) GetKey(ski []byte) (bccsp.Key, error)

GetKey returns a key for the provided SKI

func (*MemoryKeyStore) ReadOnly Uses

func (s *MemoryKeyStore) ReadOnly() bool

ReadOnly returns always false

func (*MemoryKeyStore) StoreKey Uses

func (s *MemoryKeyStore) StoreKey(key bccsp.Key) error

StoreKey stores a key

type MemoryUserStore Uses

type MemoryUserStore struct {
    // contains filtered or unexported fields

MemoryUserStore is in-memory implementation of UserStore

func NewMemoryUserStore Uses

func NewMemoryUserStore() *MemoryUserStore

NewMemoryUserStore creates a new MemoryUserStore instance

func (*MemoryUserStore) Load Uses

func (s *MemoryUserStore) Load(id msp.IdentityIdentifier) (*msp.UserData, error)

Load loads a user from store

func (*MemoryUserStore) Store Uses

func (s *MemoryUserStore) Store(user *msp.UserData) error

Store stores a user into store

type User Uses

type User struct {
    // contains filtered or unexported fields

User is a representation of a Fabric user

func (*User) EnrollmentCertificate Uses

func (u *User) EnrollmentCertificate() []byte

EnrollmentCertificate Returns the underlying ECert representing this user’s identity.

func (*User) Identifier Uses

func (u *User) Identifier() *msp.IdentityIdentifier

Identifier returns user identifier

func (*User) PrivateKey Uses

func (u *User) PrivateKey() core.Key

PrivateKey returns the crypto suite representation of the private key

func (*User) PublicVersion Uses

func (u *User) PublicVersion() msp.Identity

PublicVersion returns the public parts of this identity

func (*User) Serialize Uses

func (u *User) Serialize() ([]byte, error)

Serialize converts an identity to bytes

func (*User) Sign Uses

func (u *User) Sign(msg []byte) ([]byte, error)

Sign the message

func (*User) Verify Uses

func (u *User) Verify(msg []byte, sig []byte) error

Verify a signature over some message using this identity as reference


test/mockmspapiPackage mockmspapi is a generated GoMock package.

Package msp imports 35 packages (graph) and is imported by 5 packages. Updated 2020-07-30. Refresh now. Tools for package owners.