forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provider.go
81 lines (69 loc) · 1.9 KB
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package msp
import (
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
logApi "github.com/hyperledger/fabric-sdk-go/pkg/core/logging/api"
)
// Context is the context required by MSP services
type Context interface {
core.Providers
Providers
}
// IdentityManagerProvider provides identity management services
type IdentityManagerProvider interface {
IdentityManager(orgName string) (IdentityManager, bool)
}
//IdentityConfig contains identity configurations
type IdentityConfig interface {
Client() *ClientConfig
CAConfig(org string) (*CAConfig, bool)
CAServerCerts(org string) ([][]byte, bool)
CAClientKey(org string) ([]byte, bool)
CAClientCert(org string) ([]byte, bool)
CAKeyStorePath() string
CredentialStorePath() string
}
// ClientConfig provides the definition of the client configuration
type ClientConfig struct {
Organization string
Logging logApi.LoggingType
CryptoConfig CCType
TLSKey []byte
TLSCert []byte
CredentialStore CredentialStoreType
}
// CCType defines the path to crypto keys and certs
type CCType struct {
Path string
}
// CredentialStoreType defines pluggable KV store properties
type CredentialStoreType struct {
Path string
CryptoStore struct {
Path string
}
}
// EnrollCredentials holds credentials used for enrollment
type EnrollCredentials struct {
EnrollID string
EnrollSecret string
}
// CAConfig defines a CA configuration
type CAConfig struct {
URL string
GRPCOptions map[string]interface{}
Registrar EnrollCredentials
CAName string
TLSCAServerCerts [][]byte
TLSCAClientCert []byte
TLSCAClientKey []byte
}
// Providers represents a provider of MSP service.
type Providers interface {
UserStore() UserStore
IdentityManagerProvider
IdentityConfig() IdentityConfig
}