Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bccsp/factory/nopkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ import (

const pkcs11Enabled = false

func getDefaultImpl() *FactoryOpts {
return &FactoryOpts{
Default: "",
SW: &SwOpts{
Security: 0,
Hash: "",
},
}
}

// FactoryOpts holds configuration information used to initialize factory implementations
type FactoryOpts struct {
Default string `json:"default" yaml:"Default"`
Expand Down
12 changes: 5 additions & 7 deletions bccsp/factory/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ package factory
// GetDefaultOpts offers a default implementation for Opts
// returns a new instance every time
func GetDefaultOpts() *FactoryOpts {
return &FactoryOpts{
Default: "SW",
SW: &SwOpts{
Hash: "SHA2",
Security: 256,
},
}
fopts := getDefaultImpl()
fopts.Default = "SW"
fopts.SW.Hash = "SHA2"
fopts.SW.Security = 256
return fopts
}

// FactoryName returns the name of the provider
Expand Down
21 changes: 21 additions & 0 deletions bccsp/factory/pkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ import (

const pkcs11Enabled = false

func getDefaultImpl() *FactoryOpts {
return &FactoryOpts{
Default: "",
SW: &SwOpts{
Security: 0,
Hash: "",
},
PKCS11: &pkcs11.PKCS11Opts{
Security: 0,
Hash: "",
Library: "",
Label: "",
Pin: "",
SoftwareVerify: false,
Immutable: false,
AltID: "",
KeyIDs: nil,
},
}
}

// FactoryOpts holds configuration information used to initialize factory implementations
type FactoryOpts struct {
Default string `json:"default" yaml:"Default"`
Expand Down