Documentation ¶
Index ¶
- Variables
- type Keyring
- func (keyring *Keyring) Backend() keystore.KeyBackend
- func (keyring *Keyring) Close()
- func (keyring *Keyring) Decrypter(attrs *keystore.KeyAttributes) (crypto.Decrypter, error)
- func (keyring *Keyring) Delete(attrs *keystore.KeyAttributes) error
- func (keyring *Keyring) GenerateECDSA(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (keyring *Keyring) GenerateEd25519(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (keyring *Keyring) GenerateKey(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (keyring *Keyring) GenerateRSA(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (keyring *Keyring) Key(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (keyring *Keyring) PKCS11() keystore.KeyStorer
- func (keyring *Keyring) PKCS8() keystore.KeyStorer
- func (keyring *Keyring) Password(attrs *keystore.KeyAttributes) (keystore.Password, error)
- func (keyring *Keyring) RotateKey(attrs *keystore.KeyAttributes) (crypto.Signer, error)
- func (keyring *Keyring) Signer(attrs *keystore.KeyAttributes) (crypto.Signer, error)
- func (keyring *Keyring) Store(storeType string) (keystore.KeyStorer, error)
- func (keyring *Keyring) Stores() []keystore.KeyStorer
- func (keyring *Keyring) TPM2() keystore.KeyStorer
- func (keyring *Keyring) Verifier(attrs *keystore.KeyAttributes, opts *keystore.VerifyOpts) keystore.Verifier
- type KeyringConfig
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Keyring ¶
The Keyring provides access to all of the underlying Key Store Modules through a common API that abstracts away the implementation details of the underlying store. The Keyring also implements the key store interface itself, using the StoreType property in the KeyAttributes to route the operation to the correct Key Store Module.
func NewKeyring ¶
func NewKeyring( logger *logging.Logger, debugSecrets bool, fs afero.Fs, rootDir string, random io.Reader, config *KeyringConfig, keyBackend keystore.KeyBackend, blobStore blob.BlobStorer, signerStore keystore.SignerStorer, tpm tpm2.TrustedPlatformModule, platformKS tpm2ks.PlatformKeyStorer, soPIN keystore.Password, userPIN keystore.Password) (*Keyring, error)
Generates a new Keyring using the provided configuration to instantiate the underlying key store modules.
func (*Keyring) Backend ¶
func (keyring *Keyring) Backend() keystore.KeyBackend
Returns the backend used by the key store modules in the keyring.
func (*Keyring) Close ¶
func (keyring *Keyring) Close()
Calls close on each of the key stores and deletes the store from the internal store map.
func (*Keyring) Delete ¶
func (keyring *Keyring) Delete(attrs *keystore.KeyAttributes) error
Deletes the key pair associated with the provided key attributes
func (*Keyring) GenerateECDSA ¶
Returns an ECDSA OpaqueKey for the provided key attributes. The underlying Key Store Module must support the algorithm.
func (*Keyring) GenerateEd25519 ¶
Returns an Ed25519 OpaqueKey for the provided key attributes. The underlying Key Store Module must support the algorithm.
func (*Keyring) GenerateKey ¶
Generates a new key pair using the provided key attributes and returns an OpaqueKey implementing crypto.Signer and crypto.Decrypter backed by the underlying Key Store Module.
func (*Keyring) GenerateRSA ¶
Returns a RSA OpaqueKey for the provided key attributes. The underlying Key Store Module must support the algorithm.
func (*Keyring) Password ¶
Returns a sealed key password from the TPM using the platform PCR authorization policy. The returned secret object performs just-in-time retrieval using a PCR session policy instead of caching it on the heap. If the key doesn't have any data sealed, ErrPasswordRequired is returned so the password may be provided by the user.
func (*Keyring) RotateKey ¶
Rotates a key by overwriting the existing key with a newly generated key.
func (*Keyring) Verifier ¶
func (keyring *Keyring) Verifier( attrs *keystore.KeyAttributes, opts *keystore.VerifyOpts) keystore.Verifier
Returns a software runtime verifier to perform signature verifications. The verifier supports RSA PKCS1v15, RSA-PSS, ECDSA, and Ed25519.
type KeyringConfig ¶
type KeyringConfig struct { CN string `yaml:"cn" json:"cn" mapstructure:"cn"` PKCS8Config *pkcs8.Config `yaml:"pkcs8" json:"pkcs8" mapstructure:"pkcs8"` PKCS11Config *pkcs11.Config `yaml:"pkcs11" json:"pkcs11" mapstructure:"pkcs11"` TPMConfig *tpm2.KeyStoreConfig `yaml:"tpm2" json:"tpm2" mapstructure:"tpm2"` }