msp

package
Version: v1.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileCertStore

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

NewFileCertStore ...

func NewFileKeyStore

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

NewFileKeyStore ...

Types

type CAClientImpl

type CAClientImpl struct {
	// contains filtered or unexported fields
}

CAClientImpl implements api/msp/CAClient

func NewCAClient

func NewCAClient(orgName string, identityManager msp.IdentityManager, userStore msp.UserStore, cryptoSuite core.CryptoSuite, config core.Config) (*CAClientImpl, error)

NewCAClient creates a new CA CAClient instance

func (*CAClientImpl) Enroll

func (c *CAClientImpl) Enroll(enrollmentID string, enrollmentSecret string) 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) Reenroll

func (c *CAClientImpl) Reenroll(enrollmentID string) error

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

func (*CAClientImpl) Register

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

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

func (*CAClientImpl) Revoke

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

type CertFileUserStore

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

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

NewCertFileUserStore creates a new instance of CertFileUserStore

func NewCertFileUserStore1

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

NewCertFileUserStore1 creates a new instance of CertFileUserStore

func (*CertFileUserStore) Delete

Delete deletes a User from store

func (*CertFileUserStore) Load

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

func (*CertFileUserStore) Store

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

Store stores a User into store

type IdentityManager

type IdentityManager struct {
	// contains filtered or unexported fields
}

IdentityManager implements fab/IdentityManager

func NewIdentityManager

func NewIdentityManager(orgName string, userStore msp.UserStore, cryptoSuite core.CryptoSuite, config config.Config) (*IdentityManager, error)

NewIdentityManager creates a new instance of IdentityManager

func (*IdentityManager) GetSigningIdentity

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

GetSigningIdentity returns a signing identity for the given id

func (*IdentityManager) GetUser

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

GetUser returns a user for the given user name

func (*IdentityManager) NewUser

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

NewUser creates a User instance

type MemoryKeyStore

type MemoryKeyStore struct {
	// contains filtered or unexported fields
}

MemoryKeyStore is in-memory implementation of BCCSP key store

func NewMemoryKeyStore

func NewMemoryKeyStore(password []byte) *MemoryKeyStore

NewMemoryKeyStore creates a new MemoryKeyStore instance

func (*MemoryKeyStore) GetKey

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

GetKey returns a key for the provided SKI

func (*MemoryKeyStore) ReadOnly

func (s *MemoryKeyStore) ReadOnly() bool

ReadOnly returns always false

func (*MemoryKeyStore) StoreKey

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

StoreKey stores a key

type MemoryUserStore

type MemoryUserStore struct {
	// contains filtered or unexported fields
}

MemoryUserStore is in-memory implementation of UserStore

func NewMemoryUserStore

func NewMemoryUserStore() *MemoryUserStore

NewMemoryUserStore creates a new MemoryUserStore instance

func (*MemoryUserStore) Load

Load loads a user from store

func (*MemoryUserStore) Store

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

Store stores a user into store

type User

type User struct {
	// contains filtered or unexported fields
}

User is a representation of a Fabric user

func (*User) EnrollmentCertificate

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

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

func (*User) Identifier

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

Identifier returns user identifier

func (*User) PrivateKey

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

PrivateKey returns the crypto suite representation of the private key

func (*User) PublicVersion

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

PublicVersion returns the public parts of this identity

func (*User) Serialize

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

Serialize converts an identity to bytes

func (*User) Sign

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

Sign the message

func (*User) Verify

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

Verify a signature over some message using this identity as reference

Directories

Path Synopsis
test
mockmspapi
Package mockmspapi is a generated GoMock package.
Package mockmspapi is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL