v1.0.0-alpha3 Latest Latest

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

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




This section is empty.


View Source
var (
	// ErrKeyValueNotFound indicates that a value for the key does not exist
	ErrKeyValueNotFound = errors.New("value for key not found")


This section is empty.


type CAConfig

type CAConfig struct {
	URL         string
	HTTPOptions map[string]interface{}
	TLSCACerts  MutualTLSConfig
	Registrar   EnrollCredentials
	CAName      string

CAConfig defines a CA configuration

type CCType

type CCType struct {
	Path string

CCType defines the path to crypto keys and certs

type ChannelConfig

type ChannelConfig struct {
	// Orderers list of ordering service nodes
	Orderers []string
	// Peers a list of peer-channels that are part of this organization
	// to get the real Peer config object, use the Name field and fetch NetworkConfig.Peers[Name]
	Peers map[string]PeerChannelConfig
	// Chaincodes list of services
	Chaincodes []string

ChannelConfig provides the definition of channels for the network

type ChannelPeer

type ChannelPeer struct {

ChannelPeer combines channel peer info with raw peerConfig info

type ClientConfig

type ClientConfig struct {
	Organization    string
	Logging         LoggingType
	CryptoConfig    CCType
	TLS             TLSType
	TLSCerts        MutualTLSConfig
	CredentialStore CredentialStoreType

ClientConfig provides the definition of the client configuration

type Config

type Config interface {
	Client() (*ClientConfig, error)
	CAConfig(org string) (*CAConfig, error)
	CAServerCertPems(org string) ([]string, error)
	CAServerCertPaths(org string) ([]string, error)
	CAClientKeyPem(org string) (string, error)
	CAClientKeyPath(org string) (string, error)
	CAClientCertPem(org string) (string, error)
	CAClientCertPath(org string) (string, error)
	TimeoutOrDefault(TimeoutType) time.Duration
	Timeout(TimeoutType) time.Duration
	MSPID(org string) (string, error)
	PeerMSPID(name string) (string, error)
	OrderersConfig() ([]OrdererConfig, error)
	RandomOrdererConfig() (*OrdererConfig, error)
	OrdererConfig(name string) (*OrdererConfig, error)
	PeersConfig(org string) ([]PeerConfig, error)
	PeerConfig(org string, name string) (*PeerConfig, error)
	PeerConfigByURL(url string) (*PeerConfig, error)
	NetworkConfig() (*NetworkConfig, error)
	NetworkPeers() ([]NetworkPeer, error)
	ChannelConfig(name string) (*ChannelConfig, error)
	ChannelPeers(name string) ([]ChannelPeer, error)
	ChannelOrderers(name string) ([]OrdererConfig, error)
	TLSCACertPool(certConfig ...*x509.Certificate) (*x509.CertPool, error)
	IsSecurityEnabled() bool
	SecurityAlgorithm() string
	SecurityLevel() int
	SecurityProvider() string
	Ephemeral() bool
	SoftVerify() bool
	SecurityProviderLibPath() string
	SecurityProviderPin() string
	SecurityProviderLabel() string
	KeyStorePath() string
	CAKeyStorePath() string
	CryptoConfigPath() string
	TLSClientCerts() ([]tls.Certificate, error)
	CredentialStorePath() string
	EventServiceType() EventServiceType

Config fabric-sdk-go configuration interface

type ConfigProvider

type ConfigProvider func() (Config, error)

ConfigProvider enables creation of a Config instance

type CredentialStoreType

type CredentialStoreType struct {
	Path        string
	CryptoStore struct {
		Path string
	Wallet string

CredentialStoreType defines pluggable KV store properties

type CryptoSuite

type CryptoSuite interface {

	// KeyGen generates a key using opts.
	KeyGen(opts KeyGenOpts) (k Key, err error)

	// KeyImport imports a key from its raw representation using opts.
	// The opts argument should be appropriate for the primitive used.
	KeyImport(raw interface{}, opts KeyImportOpts) (k Key, err error)

	// GetKey returns the key this CSP associates to
	// the Subject Key Identifier ski.
	GetKey(ski []byte) (k Key, err error)

	// Hash hashes messages msg using options opts.
	// If opts is nil, the default hash function will be used.
	Hash(msg []byte, opts HashOpts) (hash []byte, err error)

	// GetHash returns and instance of hash.Hash using options opts.
	// If opts is nil, the default hash function will be returned.
	GetHash(opts HashOpts) (h hash.Hash, err error)

	// Sign signs digest using key k.
	// The opts argument should be appropriate for the algorithm used.
	// Note that when a signature of a hash of a larger message is needed,
	// the caller is responsible for hashing the larger message and passing
	// the hash (as digest).
	Sign(k Key, digest []byte, opts SignerOpts) (signature []byte, err error)

	// Verify verifies signature against key k and digest
	// The opts argument should be appropriate for the algorithm used.
	Verify(k Key, signature, digest []byte, opts SignerOpts) (valid bool, err error)

CryptoSuite adaptor for all bccsp functionalities used by SDK

type EnrollCredentials

type EnrollCredentials struct {
	EnrollID     string
	EnrollSecret string

EnrollCredentials holds credentials used for enrollment

type EventServiceType

type EventServiceType int

EventServiceType specifies the type of event service to use

const (
	// DeliverEventServiceType uses the Deliver Service for block and filtered-block events
	DeliverEventServiceType EventServiceType = iota
	// EventHubEventServiceType uses the Event Hub for block events

type HashOpts

type HashOpts interface {

	// Algorithm returns the hash algorithm identifier (to be used).
	Algorithm() string

HashOpts contains options for hashing with a CSP.

type KVStore

type KVStore interface {

	 * Store sets the value for the key.
	Store(key interface{}, value interface{}) error

	 * Load returns the value stored in the store for a key.
	 * If a value for the key was not found, returns (nil, ErrNotFound)
	Load(key interface{}) (interface{}, error)

	 * Delete deletes the value for a key.
	Delete(key interface{}) error

KVStore is a generic key-value store interface.

type Key

type Key interface {

	// Bytes converts this key to its byte representation,
	// if this operation is allowed.
	Bytes() ([]byte, error)

	// SKI returns the subject key identifier of this key.
	SKI() []byte

	// Symmetric returns true if this key is a symmetric key,
	// false is this key is asymmetric
	Symmetric() bool

	// Private returns true if this key is a private key,
	// false otherwise.
	Private() bool

	// PublicKey returns the corresponding public key part of an asymmetric public/private key pair.
	// This method returns an error in symmetric key schemes.
	PublicKey() (Key, error)

Key represents a cryptographic key

type KeyGenOpts

type KeyGenOpts interface {

	// Algorithm returns the key generation algorithm identifier (to be used).
	Algorithm() string

	// Ephemeral returns true if the key to generate has to be ephemeral,
	// false otherwise.
	Ephemeral() bool

KeyGenOpts contains options for key-generation with a CSP.

type KeyImportOpts

type KeyImportOpts interface {

	// Algorithm returns the key importation algorithm identifier (to be used).
	Algorithm() string

	// Ephemeral returns true if the key generated has to be ephemeral,
	// false otherwise.
	Ephemeral() bool

KeyImportOpts contains options for importing the raw material of a key with a CSP.

type LoggingType

type LoggingType struct {
	Level string

LoggingType defines the level of logging

type MatchConfig

type MatchConfig struct {
	Pattern                             string
	URLSubstitutionExp                  string
	EventURLSubstitutionExp             string
	SSLTargetOverrideURLSubstitutionExp string
	MappedHost                          string

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

type MutualTLSConfig

type MutualTLSConfig struct {
	Pem []string
	// Certfiles root certificates for TLS validation (Comma separated path list)
	Path string

	//Client TLS information
	Client TLSKeyPair

MutualTLSConfig Mutual TLS configurations

type NetworkConfig

type NetworkConfig struct {
	Name                   string
	Xtype                  string
	Description            string
	Version                string
	Client                 ClientConfig
	Channels               map[string]ChannelConfig
	Organizations          map[string]OrganizationConfig
	Orderers               map[string]OrdererConfig
	Peers                  map[string]PeerConfig
	CertificateAuthorities map[string]CAConfig
	EntityMatchers         map[string][]MatchConfig

NetworkConfig provides a static definition of a Hyperledger Fabric network

type NetworkPeer

type NetworkPeer struct {
	MSPID string

NetworkPeer combines peer info with MSP info

type OrdererConfig

type OrdererConfig struct {
	URL         string
	GRPCOptions map[string]interface{}
	TLSCACerts  endpoint.TLSConfig

OrdererConfig defines an orderer configuration

type OrganizationConfig

type OrganizationConfig struct {
	MSPID                  string
	CryptoPath             string
	Users                  map[string]TLSKeyPair
	Peers                  []string
	CertificateAuthorities []string
	AdminPrivateKey        endpoint.TLSConfig
	SignedCert             endpoint.TLSConfig

OrganizationConfig provides the definition of an organization in the network

type PeerChannelConfig

type PeerChannelConfig struct {
	EndorsingPeer  bool
	ChaincodeQuery bool
	LedgerQuery    bool
	EventSource    bool

PeerChannelConfig defines the peer capabilities

type PeerConfig

type PeerConfig struct {
	URL         string
	EventURL    string
	GRPCOptions map[string]interface{}
	TLSCACerts  endpoint.TLSConfig

PeerConfig defines a peer configuration

type Providers

type Providers interface {
	CryptoSuite() CryptoSuite
	Config() Config
	SigningManager() SigningManager

Providers represents the SDK configured core providers context.

type SignerOpts

type SignerOpts interface {

SignerOpts contains options for signing with a CSP.

type SigningManager

type SigningManager interface {
	Sign([]byte, Key) ([]byte, error)

SigningManager signs object with provided key

type TLSKeyPair

type TLSKeyPair struct {
	Key  endpoint.TLSConfig
	Cert endpoint.TLSConfig

TLSKeyPair contains the private key and certificate for TLS encryption

type TLSType

type TLSType struct {
	Enabled bool

TLSType defines whether or not TLS is enabled

type TimeoutType

type TimeoutType int

TimeoutType enumerates the different types of outgoing connections

const (
	// EndorserConnection connection timeout
	EndorserConnection TimeoutType = iota
	// EventHubConnection connection timeout
	// EventReg connection timeout
	// Query timeout
	// Execute timeout
	// OrdererConnection orderer connection timeout
	// OrdererResponse orderer response timeout
	// DiscoveryGreylistExpiry discovery Greylist expiration period
	// ConnectionIdle is the timeout for closing idle connections
	// CacheSweepInterval is the duration between cache sweeps
	// EventServiceIdle is the timeout for closing the event service connection
	// PeerResponse peer response timeout
	// ResMgmt timeout is default overall timeout for all resource management operations
	// ChannelConfigRefresh channel configuration refresh interval
	// ChannelMembershipRefresh channel membership refresh interval

Jump to

Keyboard shortcuts

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