Skip to content

Commit

Permalink
[FAB-6065]Config interface to expose BCCSP
Browse files Browse the repository at this point in the history
Change-Id: I0201a51e386ea2b496b15d7f577aed4597595a80
Signed-off-by: biljana lukovic <biljana.lukovic@securekey.com>
  • Loading branch information
biljanaLukovic committed Sep 7, 2017
1 parent e97aefe commit 0f6b2f6
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api/apiconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ type Config interface {
TcertBatchSize() int
SecurityAlgorithm() string
SecurityLevel() int
SecurityProvider() string
Ephemeral() bool
SecurityProviderLibPath() string
SecurityProviderPin() string
SecurityProviderLabel() string
SoftVerify() bool
KeyStorePath() string
CAKeyStorePath() string
CryptoConfigPath() string
Expand Down
63 changes: 62 additions & 1 deletion api/apiconfig/mocks/mockconfig.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions pkg/fabric-ca-client/mocks/mockconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,33 @@ func (c *MockConfig) CSPConfig() *bccspFactory.FactoryOpts {
func (c *MockConfig) NetworkConfig() (*apiconfig.NetworkConfig, error) {
return nil, nil
}

//SecurityProvider provider SW or PKCS11
func (c *MockConfig) SecurityProvider() string {
return "SW"
}

//Ephemeral flag
func (c *MockConfig) Ephemeral() bool {
return false
}

//SoftVerify flag
func (c *MockConfig) SoftVerify() bool {
return true
}

//SecurityProviderLibPath will be set only if provider is PKCS11
func (c *MockConfig) SecurityProviderLibPath() string {
return ""
}

//SecurityProviderPin will be set only if provider is PKCS11
func (c *MockConfig) SecurityProviderPin() string {
return ""
}

//SecurityProviderLabel will be set only if provider is PKCS11
func (c *MockConfig) SecurityProviderLabel() string {
return ""
}
30 changes: 30 additions & 0 deletions pkg/fabric-client/mocks/mockconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,36 @@ func (c *MockConfig) SecurityLevel() int {

}

//SecurityProvider provider SW or PKCS11
func (c *MockConfig) SecurityProvider() string {
return "SW"
}

//Ephemeral flag
func (c *MockConfig) Ephemeral() bool {
return false
}

//SoftVerify flag
func (c *MockConfig) SoftVerify() bool {
return true
}

//SecurityProviderLibPath will be set only if provider is PKCS11
func (c *MockConfig) SecurityProviderLibPath() string {
return ""
}

//SecurityProviderPin will be set only if provider is PKCS11
func (c *MockConfig) SecurityProviderPin() string {
return ""
}

//SecurityProviderLabel will be set only if provider is PKCS11
func (c *MockConfig) SecurityProviderLabel() string {
return ""
}

// OrderersConfig returns a list of defined orderers
func (c *MockConfig) OrderersConfig() ([]config.OrdererConfig, error) {
return nil, nil
Expand Down

0 comments on commit 0f6b2f6

Please sign in to comment.