Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEncryptionProviderNotRegistered = fmt.Errorf("crypto/providers: encryption provider not registered")
View Source
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 {
Encrypt(ctx context.Context, conf *v2.EncryptionConfig, plainText *v2.PlaintextData) (*v2.EncryptedData, error)
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 ¶
func GetEncryptionProviderForConfig(ctx context.Context, conf *v2.EncryptionConfig) (EncryptionProvider, error)
GetEncryptionProviderForConfig returns the 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.
Click to show internal directories.
Click to hide internal directories.