Documentation ¶
Index ¶
- Constants
- func Loader(tc cryptoprov.TokenConfig) (cryptoprov.Provider, error)
- type Provider
- func (p *Provider) ExportKey(keyID string) (string, []byte, error)
- func (p *Provider) GenerateECDSAKey(label string, curve elliptic.Curve) (crypto.PrivateKey, error)
- func (p *Provider) GenerateRSAKey(label string, bits int, purpose int) (crypto.PrivateKey, error)
- func (p *Provider) GetKey(keyID string) (crypto.PrivateKey, error)
- func (p *Provider) IdentifyKey(priv crypto.PrivateKey) (keyID, label string, err error)
- func (p *Provider) Manufacturer() string
- func (p *Provider) Model() string
- func (p *Provider) Serial() string
Constants ¶
View Source
const ProviderName = "inmem"
ProviderName specifies a provider name
Variables ¶
This section is empty.
Functions ¶
func Loader ¶ added in v0.2.0
func Loader(tc cryptoprov.TokenConfig) (cryptoprov.Provider, error)
Loader provides loader for Provider
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider defines an interface to work with crypto providers
func NewProvider ¶
func NewProvider() *Provider
NewProvider creates new provider for exportable RSA and ECDSA keys. This provider should be used only when HSM use is not applicable.
func (*Provider) GenerateECDSAKey ¶
GenerateECDSAKey creates signer using randomly generated ECDSA key
func (*Provider) GenerateRSAKey ¶
GenerateRSAKey creates signer using randomly generated RSA key
func (*Provider) GetKey ¶
func (p *Provider) GetKey(keyID string) (crypto.PrivateKey, error)
GetKey returns key for the given id
func (*Provider) IdentifyKey ¶
func (p *Provider) IdentifyKey(priv crypto.PrivateKey) (keyID, label string, err error)
IdentifyKey returns key id and label for the given private key
func (*Provider) Manufacturer ¶
Manufacturer return manufacturer for the provider
Click to show internal directories.
Click to hide internal directories.