providers

package
v0.1.42 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncryptionProviderNotRegisteredError = fmt.Errorf("crypto/providers: encryption provider not registered")

Functions

This section is empty.

Types

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 []byte) (*v2.PlaintextData, error)

	GenerateKey(ctx context.Context) (*v2.EncryptionConfig, []byte, 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 EncryptionProviderNotRegisteredError.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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