Documentation ¶
Index ¶
- func NewKeyStore(params *Params) (keystore.KeyStorer, error)
- func NewSignerECDSA(keyStore keystore.KeyStorer, signerStore keystore.SignerStorer, ...) crypto.Signer
- func NewSignerEd25519(keyStore keystore.KeyStorer, signerStore keystore.SignerStorer, ...) crypto.Signer
- func NewSignerRSA(keyStore keystore.KeyStorer, signerStore keystore.SignerStorer, ...) crypto.Signer
- type Config
- type KeyStore
- func (ks *KeyStore) Backend() keystore.KeyBackend
- func (ks *KeyStore) Close() error
- func (ks *KeyStore) Decrypter(attrs *keystore.KeyAttributes) (crypto.Decrypter, error)
- func (ks *KeyStore) Delete(attrs *keystore.KeyAttributes) error
- func (ks *KeyStore) Equal(opaque keystore.OpaqueKey, x crypto.PrivateKey) bool
- func (ks *KeyStore) GenerateECDSA(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (ks *KeyStore) GenerateEd25519(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (ks *KeyStore) GenerateKey(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (ks *KeyStore) GenerateRSA(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (ks *KeyStore) GenerateSecretKey(attrs *keystore.KeyAttributes) error
- func (ks *KeyStore) Initialize(soPIN, userPIN keystore.Password) error
- func (ks *KeyStore) Key(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (ks *KeyStore) PrivateKey(attrs *keystore.KeyAttributes) (crypto.Signer, error)
- func (ks *KeyStore) RotateKey(attrs *keystore.KeyAttributes) (keystore.OpaqueKey, error)
- func (ks *KeyStore) Signer(attrs *keystore.KeyAttributes) (crypto.Signer, error)
- func (ks *KeyStore) Type() keystore.StoreType
- func (ks *KeyStore) Verifier(attrs *keystore.KeyAttributes, opts *keystore.VerifyOpts) keystore.Verifier
- type Params
- type SignerECDSA
- type SignerEd25519
- type SignerRSA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKeyStore ¶
PKCS #8 Key Store Module. This module saves keys to the the provided backend in PKCS #8 form.
func NewSignerECDSA ¶
func NewSignerECDSA( keyStore keystore.KeyStorer, signerStore keystore.SignerStorer, keyAttributes *keystore.KeyAttributes, publicKey crypto.PublicKey) crypto.Signer
Signer that uses the Elliptical Curve Cryptography Digital Signature Algorithm (ECDSA).
Signs the requested data using the Certificate Authority Private Key, or, optionally, the private key provided via SignerOpts during the call to Sign.
func NewSignerEd25519 ¶
func NewSignerEd25519( keyStore keystore.KeyStorer, signerStore keystore.SignerStorer, keyAttributes *keystore.KeyAttributes, publicKey crypto.PublicKey) crypto.Signer
Signer that uses the Elliptical Curve Cryptography Digital Signature Algorithm (Ed25519).
Signs the requested data using the Certificate Authority Private Key, or, optionally, the private key provided via SignerOpts during the call to Sign.
func NewSignerRSA ¶
func NewSignerRSA( keyStore keystore.KeyStorer, signerStore keystore.SignerStorer, keyAttributes *keystore.KeyAttributes, publicKey crypto.PublicKey) crypto.Signer
Types ¶
type KeyStore ¶
func (*KeyStore) Backend ¶
func (ks *KeyStore) Backend() keystore.KeyBackend
Returns the key store backend
func (*KeyStore) Decrypter ¶
Returns a PKCS #8 crypto.Decrypter from the dedicated encryption keys partition.
func (*KeyStore) Delete ¶
func (ks *KeyStore) Delete(attrs *keystore.KeyAttributes) error
Deletes a key pair from the key store
func (*KeyStore) Equal ¶
Compares an opaque key with the provided key This is the PKCA #8 key store. implementation for the opaque key's crypto.PrivateKey implementation https://pkg.go.dev/crypto#PrivateKey
func (*KeyStore) GenerateECDSA ¶
Generates a new ECDSA private key and return and OpaqueKey implementing crypto.Signer
func (*KeyStore) GenerateEd25519 ¶
Generates a new Ed25519 private key and return and OpaqueKey implementing crypto.Signer
func (*KeyStore) GenerateKey ¶
Generate new private key using the provided key attributes and return an OpaqueKey implementing crypto.Signer
func (*KeyStore) GenerateRSA ¶
Generate new RSA private key and return an OpaqueKey implementing crypto.Signer
func (*KeyStore) GenerateSecretKey ¶
func (ks *KeyStore) GenerateSecretKey( attrs *keystore.KeyAttributes) error
Generates a new AES-256 32 byte secret key
func (*KeyStore) Initialize ¶
No-op method that implements keystore.KeyStorer
func (*KeyStore) Key ¶
Returns a private key RSA key backed by this PKCS #8 key store. for signing and decryption operations
func (*KeyStore) PrivateKey ¶
Returns a private key RSA key backed by this PKCS #8 key store. for signing and decryption operations
func (*KeyStore) RotateKey ¶
Rotates an existing key by generating a new key pair and overwriting the existing key. This is a destructive operation that will cause the existing key pair to be irrecoverable.
func (*KeyStore) Verifier ¶
func (ks *KeyStore) Verifier( attrs *keystore.KeyAttributes, opts *keystore.VerifyOpts) keystore.Verifier
Returns a custom PKCS #8 verifier
type Params ¶
type Params struct { Config *Config DebugSecrets bool Logger *logging.Logger Random io.Reader Backend keystore.KeyBackend SignerStore keystore.SignerStorer BlobStore blobstore.BlobStorer TPMKS tpmks.PlatformKeyStorer }
type SignerECDSA ¶
func (SignerECDSA) Public ¶
func (signer SignerECDSA) Public() crypto.PublicKey
Returns the public half of the signing key
func (SignerECDSA) Sign ¶
func (signer SignerECDSA) Sign( rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
Signs the requested digest using the PKCS #8 private key
type SignerEd25519 ¶
func (SignerEd25519) Public ¶
func (signer SignerEd25519) Public() crypto.PublicKey
Returns the public half of the signing key
func (SignerEd25519) Sign ¶
func (signer SignerEd25519) Sign( rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
Signs the requested digest using the PKCS #8 private key