decrypt

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

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.

func (Decrypter) Decrypt

func (d Decrypter) Decrypt(input string) (string, error)

Decrypt decrypts the given input string using the private key. Returns the decrypted string or an error if decryption fails.

type GetGlobalConfigFunc

type GetGlobalConfigFunc func(ignoreKeys []string) (core.GlobalConfig, error)

GetGlobalConfigFunc defines a function type that retrieves the global config, optionally ignoring some keys.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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