factory

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright IBM Corp. 2017 All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright IBM Corp. 2017 All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright IBM Corp. 2016 All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. 2016 All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	PKCS11BasedFactoryName = "PKCS11"
)
View Source
const (
	PluginFactoryName = "PLUGIN"
)
View Source
const (
	SoftwareBasedFactoryName = "SW"
)

Variables

View Source
var (
	DefaultBCCSP bccsp.BCCSP
)

Functions

func GetBCCSPFromOpts

func GetBCCSPFromOpts(config *FactoryOpts) (bccsp.BCCSP, error)

func GetDefault

func GetDefault() bccsp.BCCSP

func InitFactories

func InitFactories(config *FactoryOpts) error

Types

type BCCSPFactory

type BCCSPFactory interface {
	Name() string

	Get(opts *FactoryOpts) (bccsp.BCCSP, error)
}

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"`
	PluginOpts   *PluginOpts        `mapstructure:"PLUGIN,omitempty" json:"PLUGIN,omitempty" yaml:"PluginOpts"`
	Pkcs11Opts   *pkcs11.PKCS11Opts `mapstructure:"PKCS11,omitempty" json:"PKCS11,omitempty" yaml:"PKCS11"`
}

func GetDefaultOpts

func GetDefaultOpts() *FactoryOpts

func (*FactoryOpts) FactoryName

func (o *FactoryOpts) FactoryName() string

type FileKeystoreOpts

type FileKeystoreOpts struct {
	KeyStorePath string `mapstructure:"keystore" yaml:"KeyStore"`
}

type InmemKeystoreOpts

type InmemKeystoreOpts struct{}

type PKCS11Factory

type PKCS11Factory struct{}

func (*PKCS11Factory) Get

func (f *PKCS11Factory) Get(config *FactoryOpts) (bccsp.BCCSP, error)

func (*PKCS11Factory) Name

func (f *PKCS11Factory) Name() string

type PluginFactory

type PluginFactory struct{}

func (*PluginFactory) Get

func (f *PluginFactory) Get(config *FactoryOpts) (bccsp.BCCSP, error)

func (*PluginFactory) Name

func (f *PluginFactory) Name() string

type PluginOpts

type PluginOpts struct {
	Library string

	Config map[string]interface{}
}

type SWFactory

type SWFactory struct{}

func (*SWFactory) Get

func (f *SWFactory) Get(config *FactoryOpts) (bccsp.BCCSP, error)

func (*SWFactory) Name

func (f *SWFactory) Name() string

type SwOpts

type SwOpts struct {
	SecLevel   int    `mapstructure:"security" json:"security" yaml:"Security"`
	HashFamily string `mapstructure:"hash" json:"hash" yaml:"Hash"`

	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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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