Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEncryptionProviderNotRegistered = fmt.Errorf("crypto/providers: encryption provider not registered")
var ErrNoProviderSpecified = fmt.Errorf("crypto/providers: no provider specified")
Functions ¶
This section is empty.
Types ¶
type DecryptionConfig ¶ added in v0.4.0
type DecryptionConfig struct {
Provider string
PrivateKey *jose.JSONWebKey
}
type EncryptionProvider ¶
type EncryptionProvider interface {
Encryptor
Decrypt(ctx context.Context, cipherText *v2.EncryptedData, privateKey *jose.JSONWebKey) (*v2.PlaintextData, error)
GenerateKey(ctx context.Context) (*v2.EncryptionConfig, *jose.JSONWebKey, error)
}
func GetDecryptionProviderForConfig ¶ added in v0.4.0
func GetDecryptionProviderForConfig(ctx context.Context, conf *DecryptionConfig) (EncryptionProvider, error)
func GetEncryptionProvider ¶
func GetEncryptionProvider(name string) (EncryptionProvider, error)
func GetEncryptionProviderForConfig
deprecated
func GetEncryptionProviderForConfig(ctx context.Context, conf *v2.EncryptionConfig) (EncryptionProvider, error)
GetEncryptionProviderForConfig returns the full encryption provider for the given config. If the config specifies a provider, we will fetch it directly by name and return an error if it's not found. If the config contains a non-nil well-known configuration (like JWKPublicKeyConfig), we will return the provider for that by name. If we can't find a provider, we return an ErrEncryptionProviderNotRegistered.
Deprecated: use GetEncryptorForConfig for encryption. This legacy resolver returns only providers that also implement decryption and key generation, so it cannot resolve encryption-only configurations such as age recipients.
type Encryptor ¶ added in v0.20.1
type Encryptor interface {
Encrypt(ctx context.Context, conf *v2.EncryptionConfig, plainText *v2.PlaintextData) (*v2.EncryptedData, error)
}
Encryptor encrypts connector plaintext for one configured recipient.
func GetEncryptor ¶ added in v0.20.1
GetEncryptor returns the encryption-capable provider registered under name.
func GetEncryptorForConfig ¶ added in v0.20.1
GetEncryptorForConfig resolves an encryption-capable provider from an EncryptionConfig.