Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeyProvider ¶
func GetKeyProvider(getGCfg GetGlobalConfigFunc) (*keys.KeyProvider, error)
GetKeyProvider initializes and returns a singleton instance of KeyProvider. It reads the global config using the provided function and extracts the key provider configuration.
The function ensures thread-safe lazy initialization and returns the same instance for subsequent calls. If an error occurs during initialization, it is returned alongside a nil provider.
Types ¶
type Decrypter ¶
type Decrypter struct {
// contains filtered or unexported fields
}
Decrypter is a wrapper around a private key that can decrypt encrypted input.
func CreateDecrypter ¶
func CreateDecrypter(dogu string, getGCfg GetGlobalConfigFunc) (Decrypter, error)
CreateDecrypter creates a Decrypter instance using the private key for the specified dogu. It retrieves the KeyProvider and loads the private key from the filesystem. Returns an error if the provider or private key could not be retrieved.
type GetGlobalConfigFunc ¶
type GetGlobalConfigFunc func(ignoreKeys []string) (core.GlobalConfig, error)
GetGlobalConfigFunc defines a function type that retrieves the global config, optionally ignoring some keys.