Documentation ¶
Index ¶
Constants ¶
const (
// SoftwareBasedFactoryName is the name of the factory of the software-based CSP implementation
SoftwareBasedFactoryName = "SW"
)
Variables ¶
This section is empty.
Functions ¶
func GetCSPFromOpts ¶
func GetCSPFromOpts(config *FactoryOpts) (csp.CSP, error)
GetCSPFromOpts returns a CSP created according to the options passed in input.
func InitFactories ¶
func InitFactories(config *FactoryOpts) error
InitFactories must be called before using factory interfaces It is acceptable to call with config = nil, in which case some defaults will get used Error is returned only if defaultCSP cannot be found
Types ¶
type CSPFactory ¶
type CSPFactory interface { // Name returns the name of this factory Name() string // Get returns an instance of CSP using opts. Get(opts *FactoryOpts) (csp.CSP, error) }
CSPFactory is used to get instances of the CSP interface. A Factory has name used to address it.
type DummyKeystoreOpts ¶
type DummyKeystoreOpts struct{}
type FactoryOpts ¶
type FactoryOpts struct { ProviderName string `mapstructure:"default" json:"default" yaml:"Default"` SwOpts *SwOpts `mapstructure:"SW,omitempty" json:"SW,omitempty" yaml:"SwOpts"` }
FactoryOpts holds configuration information used to initialize factory implementations
func GetDefaultOpts ¶
func GetDefaultOpts() *FactoryOpts
GetDefaultOpts offers a default implementation for Opts returns a new instance every time
func (*FactoryOpts) FactoryName ¶
func (o *FactoryOpts) FactoryName() string
FactoryName returns the name of the provider
type FileKeystoreOpts ¶
type FileKeystoreOpts struct {
KeyStorePath string `mapstructure:"keystore" yaml:"KeyStore"`
}
Pluggable Keystores, could add JKS, P12, etc..
type InmemKeystoreOpts ¶
type InmemKeystoreOpts struct{}
InmemKeystoreOpts - empty, as there is no config for the in-memory keystore
type SWFactory ¶
type SWFactory struct{}
SWFactory is the factory of the software-based CSP.
type SwOpts ¶
type SwOpts struct { // Default algorithms when not specified (Deprecated?) SecLevel int `mapstructure:"security" json:"security" yaml:"Security"` HashFamily string `mapstructure:"hash" json:"hash" yaml:"Hash"` // Keystore Options Ephemeral bool `mapstructure:"tempkeys,omitempty" json:"tempkeys,omitempty"` FileKeystore *FileKeystoreOpts `mapstructure:"filekeystore,omitempty" json:"filekeystore,omitempty" yaml:"FileKeyStore"` DummyKeystore *DummyKeystoreOpts `mapstructure:"dummykeystore,omitempty" json:"dummykeystore,omitempty"` InmemKeystore *InmemKeystoreOpts `mapstructure:"inmemkeystore,omitempty" json:"inmemkeystore,omitempty"` }
SwOpts contains options for the SWFactory