encryption

package
v0.0.0-...-1a90eba Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecryption

func AesDecryption(encryptedData string, vaultPath string) (string, error)

func AesDecryptionWithPassphrase

func AesDecryptionWithPassphrase(encryptedData string, vaultPath string, passphrase string) (string, error)

AesDecryptionWithPassphrase decrypts data using the vault's encryption key The passphrase is used to decrypt the encryption key if the vault is passphrase protected

func AesEncryptWithPassphrase

func AesEncryptWithPassphrase(data string, vaultConfig config.VaultConfig, passphrase string) (string, error)

AesEncryptWithPassphrase encrypts data using the vault's encryption key The passphrase is used to decrypt the encryption key if the vault is passphrase protected

func AesEncryption

func AesEncryption(data string, vaultConfig config.VaultConfig) (string, error)

func DecryptData

func DecryptData(encryptedData string, vaultPath string) (string, error)

DecryptData decrypts data using the configured encryption method

func DecryptDataWithPassphrase

func DecryptDataWithPassphrase(encryptedData string, vaultPath string, passphrase string) (string, error)

DecryptDataWithPassphrase decrypts data using the configured encryption method with passphrase

func EncryptData

func EncryptData(data string, vaultConfig config.VaultConfig) (string, error)

EncryptData encrypts data using the configured encryption method

func EncryptDataWithPassphrase

func EncryptDataWithPassphrase(data string, vaultConfig config.VaultConfig, passphrase string) (string, error)

EncryptDataWithPassphrase encrypts data using the configured encryption method with passphrase

func GPGDecryption

func GPGDecryption(encryptedData string, vaultPath string) (string, error)

GPGDecryption decrypts GPG-encrypted data

func GPGDecryptionWithPassphrase

func GPGDecryptionWithPassphrase(encryptedData string, vaultPath string, passphrase string) (string, error)

GPGDecryptionWithPassphrase decrypts GPG-encrypted data using a passphrase

func GPGEncryptWithPassphrase

func GPGEncryptWithPassphrase(data string, vaultConfig config.VaultConfig, passphrase string) (string, error)

GPGEncryptWithPassphrase encrypts data using GPG with passphrase support

func GPGEncryption

func GPGEncryption(data string, vaultConfig config.VaultConfig) (string, error)

GPGEncryption encrypts data using GPG with the configured recipient

func GenerateGPGKeyConfig

func GenerateGPGKeyConfig(vaultConfig *config.VaultConfig, selectedKey *gpgencyption.GPGKeyInfo) (*config.KeyConfig, error)

GenerateGPGKeyConfig creates a GPG key configuration for vault initialization

func GetEncryptionDetails

func GetEncryptionDetails(vaultConfig config.VaultConfig) (string, error)

GetEncryptionDetails returns human-readable encryption details

func IsGPGAvailable

func IsGPGAvailable() bool

IsGPGAvailable checks if GPG is available on the system

func ListAvailableGPGKeys

func ListAvailableGPGKeys() ([]*gpgencyption.GPGKeyInfo, error)

ListAvailableGPGKeys returns a list of available GPG keys

func PromptSecurityConfig

func PromptSecurityConfig(configuration *config.VaultConfig) error

PromptSecurityConfig asks for security-related configuration

func SetupGPGEncryption

func SetupGPGEncryption(vaultConfig *config.VaultConfig, keyConfig *config.KeyConfig) error

SetupGPGEncryption configures GPG encryption for a vault

func ValidateEncryptionConfiguration

func ValidateEncryptionConfiguration(vaultConfig config.VaultConfig) error

ValidateEncryptionConfiguration validates the encryption configuration

func ValidateGPGConfiguration

func ValidateGPGConfiguration(vaultConfig config.VaultConfig) error

ValidateGPGConfiguration validates the GPG configuration

Types

type GPGKeyDetails

type GPGKeyDetails struct {
	KeyID       string
	Fingerprint string
	Recipient   string
	KeyServer   string
}

GPGKeyDetails contains detailed information about a GPG key

func GetGPGKeyInfo

func GetGPGKeyInfo(vaultConfig config.VaultConfig) (*GPGKeyDetails, error)

GetGPGKeyInfo retrieves detailed information about the configured GPG key

func (*GPGKeyDetails) String

func (g *GPGKeyDetails) String() string

String returns a human-readable representation of the GPG key details

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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