mocks

package
v0.0.0-...-e171dc0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enroll

func Enroll(w http.ResponseWriter, req *http.Request)

Enroll user

func NewMockConfig

func NewMockConfig(CAServerURL string) apiconfig.Config

NewMockConfig ...

func Reenroll

func Reenroll(w http.ResponseWriter, req *http.Request)

Reenroll user

func Register

func Register(w http.ResponseWriter, req *http.Request)

Register user

func StartFabricCAMockServer

func StartFabricCAMockServer(address string) error

StartFabricCAMockServer Start fabric ca mock server

Types

type MockConfig

type MockConfig struct {
	CAServerURL string
}

MockConfig ...

func (*MockConfig) CAClientCertFile

func (c *MockConfig) CAClientCertFile(org string) (string, error)

CAClientCertFile Read configuration option for the fabric CA client cert file

func (*MockConfig) CAClientKeyFile

func (c *MockConfig) CAClientKeyFile(org string) (string, error)

CAClientKeyFile Read configuration option for the fabric CA client key file

func (*MockConfig) CAConfig

func (c *MockConfig) CAConfig(org string) (*apiconfig.CAConfig, error)

CAConfig return ca configuration

func (*MockConfig) CAKeyStorePath

func (c *MockConfig) CAKeyStorePath() string

CAKeyStorePath ...

func (*MockConfig) CAServerCertFiles

func (c *MockConfig) CAServerCertFiles(org string) ([]string, error)

CAServerCertFiles Read configuration option for the server certificate files

func (*MockConfig) CSPConfig

func (c *MockConfig) CSPConfig() *bccspFactory.FactoryOpts

CSPConfig ...

func (*MockConfig) ChannelConfig

func (c *MockConfig) ChannelConfig(name string) (*apiconfig.ChannelConfig, error)

ChannelConfig returns the channel configuration

func (*MockConfig) ChannelPeers

func (c *MockConfig) ChannelPeers(name string) ([]apiconfig.ChannelPeer, error)

ChannelPeers returns the channel peers configuration

func (*MockConfig) Client

func (c *MockConfig) Client() (*apiconfig.ClientConfig, error)

Client returns the Client config

func (*MockConfig) CryptoConfigPath

func (c *MockConfig) CryptoConfigPath() string

CryptoConfigPath ...

func (*MockConfig) Ephemeral

func (c *MockConfig) Ephemeral() bool

Ephemeral flag

func (*MockConfig) IsSecurityEnabled

func (c *MockConfig) IsSecurityEnabled() bool

IsSecurityEnabled ...

func (*MockConfig) KeyStorePath

func (c *MockConfig) KeyStorePath() string

KeyStorePath ...

func (*MockConfig) MspID

func (c *MockConfig) MspID(org string) (string, error)

MspID ...

func (*MockConfig) NetworkConfig

func (c *MockConfig) NetworkConfig() (*apiconfig.NetworkConfig, error)

NetworkConfig not implemented

func (*MockConfig) OrdererConfig

func (c *MockConfig) OrdererConfig(name string) (*apiconfig.OrdererConfig, error)

OrdererConfig not implemented

func (*MockConfig) OrderersConfig

func (c *MockConfig) OrderersConfig() ([]apiconfig.OrdererConfig, error)

OrderersConfig returns a list of defined orderers

func (*MockConfig) PeerConfig

func (c *MockConfig) PeerConfig(org string, name string) (*apiconfig.PeerConfig, error)

PeerConfig Retrieves a specific peer from the configuration by org and name

func (*MockConfig) PeersConfig

func (c *MockConfig) PeersConfig(org string) ([]apiconfig.PeerConfig, error)

PeersConfig Retrieves the fabric peers from the config file provided

func (*MockConfig) RandomOrdererConfig

func (c *MockConfig) RandomOrdererConfig() (*apiconfig.OrdererConfig, error)

RandomOrdererConfig not implemented

func (*MockConfig) SecurityAlgorithm

func (c *MockConfig) SecurityAlgorithm() string

SecurityAlgorithm ...

func (*MockConfig) SecurityLevel

func (c *MockConfig) SecurityLevel() int

SecurityLevel ...

func (*MockConfig) SecurityProvider

func (c *MockConfig) SecurityProvider() string

SecurityProvider provider SW or PKCS11

func (*MockConfig) SecurityProviderLabel

func (c *MockConfig) SecurityProviderLabel() string

SecurityProviderLabel will be set only if provider is PKCS11

func (*MockConfig) SecurityProviderLibPath

func (c *MockConfig) SecurityProviderLibPath() string

SecurityProviderLibPath will be set only if provider is PKCS11

func (*MockConfig) SecurityProviderPin

func (c *MockConfig) SecurityProviderPin() string

SecurityProviderPin will be set only if provider is PKCS11

func (*MockConfig) SetTLSCACertPool

func (c *MockConfig) SetTLSCACertPool(pool *x509.CertPool)

SetTLSCACertPool ...

func (*MockConfig) SoftVerify

func (c *MockConfig) SoftVerify() bool

SoftVerify flag

func (*MockConfig) TLSCACertPool

func (c *MockConfig) TLSCACertPool(tlsCertificate string) (*x509.CertPool, error)

TLSCACertPool ...

func (*MockConfig) TcertBatchSize

func (c *MockConfig) TcertBatchSize() int

TcertBatchSize ...

func (*MockConfig) TimeoutOrDefault

func (c *MockConfig) TimeoutOrDefault(apiconfig.TimeoutType) time.Duration

TimeoutOrDefault not implemented

type MockKey

type MockKey struct {
}

MockKey mocks BCCSP key

func (*MockKey) Bytes

func (m *MockKey) Bytes() ([]byte, error)

Bytes ...

func (*MockKey) Private

func (m *MockKey) Private() bool

Private ...

func (*MockKey) PublicKey

func (m *MockKey) PublicKey() (bccsp.Key, error)

PublicKey ...

func (*MockKey) SKI

func (m *MockKey) SKI() []byte

SKI ...

func (*MockKey) Symmetric

func (m *MockKey) Symmetric() bool

Symmetric ...

type MockUser

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

MockUser ...

func NewMockUser

func NewMockUser(name string) *MockUser

NewMockUser ... *

  • Constructor for a user. *
  • @param {string} name - The user name

func (*MockUser) EnrollmentCertificate

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

EnrollmentCertificate ... *

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

func (*MockUser) GenerateTcerts

func (u *MockUser) GenerateTcerts(count int, attributes []string)

GenerateTcerts ... *

  • Gets a batch of TCerts to use for transaction. there is a 1-to-1 relationship between
  • TCert and Transaction. The TCert can be generated locally by the SDK using the user’s crypto materials.
  • @param {int} count how many in the batch to obtain
  • @param {[]string} attributes list of attributes to include in the TCert
  • @return {[]tcert} An array of TCerts

func (*MockUser) Identity

func (u *MockUser) Identity() ([]byte, error)

Identity returns MockUser's serialized identity

func (*MockUser) MspID

func (u *MockUser) MspID() string

MspID returns the MSP for this user

func (*MockUser) Name

func (u *MockUser) Name() string

Name ... *

  • Get the user name.
  • @returns {string} The user name.

func (*MockUser) PrivateKey

func (u *MockUser) PrivateKey() bccsp.Key

PrivateKey ... *

  • deprecated.

func (*MockUser) Roles

func (u *MockUser) Roles() []string

Roles ... *

  • Get the roles.
  • @returns {[]string} The roles.

func (*MockUser) SetEnrollmentCertificate

func (u *MockUser) SetEnrollmentCertificate(cert []byte)

SetEnrollmentCertificate ... *

  • Set the user’s Enrollment Certificate.

func (*MockUser) SetMspID

func (u *MockUser) SetMspID(mspID string)

SetMspID sets the MSP for this user

func (*MockUser) SetPrivateKey

func (u *MockUser) SetPrivateKey(privateKey bccsp.Key)

SetPrivateKey ... *

  • deprecated.

func (*MockUser) SetRoles

func (u *MockUser) SetRoles(roles []string)

SetRoles ... *

  • Set the roles.
  • @param roles {[]string} The roles.

Jump to

Keyboard shortcuts

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