cryptoengines

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateVaultSdkClient

func CreateVaultSdkClient(httpClient *http.Client, vaultAddress string) (*api.Client, error)

---------------------

func Login

func Login(client *api.Client, roleID string, secretID string) error

func Unseal

func Unseal(client *api.Client, unsealKeys []config.Password) error

Types

type AWSKMSCryptoEngine

type AWSKMSCryptoEngine struct {
	// contains filtered or unexported fields
}

func (*AWSKMSCryptoEngine) CreateECDSAPrivateKey

func (p *AWSKMSCryptoEngine) CreateECDSAPrivateKey(curve elliptic.Curve, keyID string) (crypto.Signer, error)

func (*AWSKMSCryptoEngine) CreateRSAPrivateKey

func (p *AWSKMSCryptoEngine) CreateRSAPrivateKey(keySize int, keyID string) (crypto.Signer, error)

func (*AWSKMSCryptoEngine) DeleteKey

func (p *AWSKMSCryptoEngine) DeleteKey(keyID string) error

func (*AWSKMSCryptoEngine) GetEngineConfig

func (p *AWSKMSCryptoEngine) GetEngineConfig() models.CryptoEngineInfo

func (*AWSKMSCryptoEngine) GetPrivateKeyByID

func (p *AWSKMSCryptoEngine) GetPrivateKeyByID(keyAlias string) (crypto.Signer, error)

func (*AWSKMSCryptoEngine) ImportECDSAPrivateKey

func (p *AWSKMSCryptoEngine) ImportECDSAPrivateKey(key *ecdsa.PrivateKey, keyID string) (crypto.Signer, error)

func (*AWSKMSCryptoEngine) ImportRSAPrivateKey

func (p *AWSKMSCryptoEngine) ImportRSAPrivateKey(key *rsa.PrivateKey, keyID string) (crypto.Signer, error)

type AWSSecretsManagerCryptoEngine

type AWSSecretsManagerCryptoEngine struct {
	// contains filtered or unexported fields
}

func (*AWSSecretsManagerCryptoEngine) CreateECDSAPrivateKey

func (engine *AWSSecretsManagerCryptoEngine) CreateECDSAPrivateKey(curve elliptic.Curve, keyID string) (crypto.Signer, error)

func (*AWSSecretsManagerCryptoEngine) CreateRSAPrivateKey

func (engine *AWSSecretsManagerCryptoEngine) CreateRSAPrivateKey(keySize int, keyID string) (crypto.Signer, error)

func (*AWSSecretsManagerCryptoEngine) DeleteKey

func (engine *AWSSecretsManagerCryptoEngine) DeleteKey(keyID string) error

func (*AWSSecretsManagerCryptoEngine) GetEngineConfig

func (engine *AWSSecretsManagerCryptoEngine) GetEngineConfig() models.CryptoEngineInfo

func (*AWSSecretsManagerCryptoEngine) GetPrivateKeyByID

func (engine *AWSSecretsManagerCryptoEngine) GetPrivateKeyByID(keyID string) (crypto.Signer, error)

func (*AWSSecretsManagerCryptoEngine) ImportECDSAPrivateKey

func (engine *AWSSecretsManagerCryptoEngine) ImportECDSAPrivateKey(key *ecdsa.PrivateKey, keyID string) (crypto.Signer, error)

func (*AWSSecretsManagerCryptoEngine) ImportRSAPrivateKey

func (engine *AWSSecretsManagerCryptoEngine) ImportRSAPrivateKey(key *rsa.PrivateKey, keyID string) (crypto.Signer, error)

type CryptoEngine

type CryptoEngine interface {
	GetEngineConfig() models.CryptoEngineInfo

	GetPrivateKeyByID(keyID string) (crypto.Signer, error)

	CreateRSAPrivateKey(keySize int, keyID string) (crypto.Signer, error)
	CreateECDSAPrivateKey(curve elliptic.Curve, keyID string) (crypto.Signer, error)

	ImportRSAPrivateKey(key *rsa.PrivateKey, keyID string) (crypto.Signer, error)
	ImportECDSAPrivateKey(key *ecdsa.PrivateKey, keyID string) (crypto.Signer, error)
}

func NewAWSKMSEngine

func NewAWSKMSEngine(logger *logrus.Entry, awsConf aws.Config, metadata map[string]any) (CryptoEngine, error)

func NewAWSSecretManagerEngine

func NewAWSSecretManagerEngine(logger *logrus.Entry, awsConf aws.Config, metadata map[string]any) (CryptoEngine, error)

func NewGolangPEMEngine

func NewGolangPEMEngine(logger *logrus.Entry, conf config.GolangEngineConfig) CryptoEngine

func NewPKCS11Engine

func NewPKCS11Engine(logger *logrus.Entry, conf config.PKCS11EngineConfig) (CryptoEngine, error)

type GoCryptoEngine

type GoCryptoEngine struct {
	// contains filtered or unexported fields
}

func (*GoCryptoEngine) CreateECDSAPrivateKey

func (p *GoCryptoEngine) CreateECDSAPrivateKey(curve elliptic.Curve, keyID string) (crypto.Signer, error)

func (*GoCryptoEngine) CreateRSAPrivateKey

func (p *GoCryptoEngine) CreateRSAPrivateKey(keySize int, keyID string) (crypto.Signer, error)

func (*GoCryptoEngine) DeleteKey

func (p *GoCryptoEngine) DeleteKey(keyID string) error

func (*GoCryptoEngine) GetEngineConfig

func (p *GoCryptoEngine) GetEngineConfig() models.CryptoEngineInfo

func (*GoCryptoEngine) GetPrivateKeyByID

func (p *GoCryptoEngine) GetPrivateKeyByID(keyID string) (crypto.Signer, error)

func (*GoCryptoEngine) ImportECDSAPrivateKey

func (p *GoCryptoEngine) ImportECDSAPrivateKey(key *ecdsa.PrivateKey, keyID string) (crypto.Signer, error)

func (*GoCryptoEngine) ImportRSAPrivateKey

func (p *GoCryptoEngine) ImportRSAPrivateKey(key *rsa.PrivateKey, keyID string) (crypto.Signer, error)

type VaultKV2Engine

type VaultKV2Engine struct {
	// contains filtered or unexported fields
}

func (*VaultKV2Engine) CreateECDSAPrivateKey

func (vaultCli *VaultKV2Engine) CreateECDSAPrivateKey(c elliptic.Curve, keyID string) (crypto.Signer, error)

func (*VaultKV2Engine) CreateRSAPrivateKey

func (vaultCli *VaultKV2Engine) CreateRSAPrivateKey(keySize int, keyID string) (crypto.Signer, error)

func (*VaultKV2Engine) DeleteKey

func (vaultCli *VaultKV2Engine) DeleteKey(keyID string) error

func (*VaultKV2Engine) GetEngineConfig

func (vaultCli *VaultKV2Engine) GetEngineConfig() models.CryptoEngineInfo

func (*VaultKV2Engine) GetPrivateKeyByID

func (vaultCli *VaultKV2Engine) GetPrivateKeyByID(keyID string) (crypto.Signer, error)

func (*VaultKV2Engine) ImportECDSAPrivateKey

func (vaultCli *VaultKV2Engine) ImportECDSAPrivateKey(key *ecdsa.PrivateKey, keyID string) (crypto.Signer, error)

func (*VaultKV2Engine) ImportRSAPrivateKey

func (vaultCli *VaultKV2Engine) ImportRSAPrivateKey(key *rsa.PrivateKey, keyID string) (crypto.Signer, error)

Jump to

Keyboard shortcuts

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