csp

package
v0.0.0-...-bf8fb4d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SKIPEM is the PEM type to identify an SKI (Subject Key Identifier)
	SKIPEM = "BCCSP SKI"
)

Variables

This section is empty.

Functions

func GenRootKey

func GenRootKey(csp bccsp.BCCSP) (bccsp.Key, error)

GenRootKey generates a new root key

func Get

func Get(cfg *Config) (bccsp.BCCSP, error)

Get returns an instance of the CSP (Crypto Service Provider) given some config. If config is nil, return the default instance.

func GetSignerFromSKIFile

func GetSignerFromSKIFile(skiFile string, csp bccsp.BCCSP) (crypto.Signer, error)

GetSignerFromSKIFile returns a signer for an SKI file

Types

type Config

type Config struct {
	SW *SWConfig `json:"software,omitempty"`
}

Config is the configuration for CSP (Crypto Service Provider) which allows plugging in support for HSMs (Hardware Service Modules) Currently supported types are: 'software'

func (*Config) Get

func (c *Config) Get() (bccsp.BCCSP, error)

Get returns the instance of BCCSP for the config

type SWConfig

type SWConfig struct {
	KeyStoreDir   string `json:"key_store_dir,omitempty"`
	HashFamily    string `json:"hash_family,omitempty"`
	SecurityLevel int    `json:"security_level,omitempty"`
	Ephemeral     bool   `json:"ephemeral,omitempty"`
}

SWConfig is configuration for the software implementation of CSP

func (*SWConfig) Get

func (sc *SWConfig) Get() (bccsp.BCCSP, error)

Get returns the instance of the software CSP

Jump to

Keyboard shortcuts

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