Documentation
¶
Index ¶
- func DecryptBackupFile(backupPath string, decrypt bool, identityFiles []string) (string, bool, error)
- func DecryptFile(inputPath, outputPath string, opts *DecryptOptions) error
- func DecryptFileWithIdentities(inputPath, outputPath string, identityFiles []string) error
- func DecryptFileWithPassphrase(inputPath, outputPath, passphrase string) error
- func EncryptBackupFile(backupPath string, encrypt bool, recipients []string) (string, error)
- func EncryptFile(inputPath, outputPath string, opts *EncryptOptions) error
- func EncryptFileWithPassphrase(inputPath, outputPath, passphrase string) error
- func EncryptFileWithRecipients(inputPath, outputPath string, recipients []string) error
- func FindLatestBackup(dir, pattern string) (string, error)
- func GetIdentityFilesFromEnv() []string
- func GetPassphraseFromEnv() string
- func GetRecipientsFromEnv() []string
- func IsEncrypted(path string) bool
- func ReadAndConfirmPassphrase() (string, error)
- func ReadPassphrase(prompt string) (string, error)
- func ReadPassphraseForDecryption() (string, error)
- func ValidatePassphrase(passphrase string) error
- type DecryptOptions
- type EncryptOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptBackupFile ¶
func DecryptBackupFile(backupPath string, decrypt bool, identityFiles []string) (string, bool, error)
DecryptBackupFile decrypts a backup file if needed Returns the path to the decrypted file (temp file or original if not encrypted) The caller is responsible for cleaning up the temp file if one was created
func DecryptFile ¶
func DecryptFile(inputPath, outputPath string, opts *DecryptOptions) error
DecryptFile decrypts an age-encrypted file
func DecryptFileWithIdentities ¶
DecryptFileWithIdentities is a convenience function for identity-based decryption
func DecryptFileWithPassphrase ¶
DecryptFileWithPassphrase is a convenience function for passphrase decryption
func EncryptBackupFile ¶
EncryptBackupFile encrypts a backup file if encryption options are provided Returns the path to the encrypted file (or original if no encryption)
func EncryptFile ¶
func EncryptFile(inputPath, outputPath string, opts *EncryptOptions) error
EncryptFile encrypts a file using age encryption
func EncryptFileWithPassphrase ¶
EncryptFileWithPassphrase is a convenience function for passphrase encryption
func EncryptFileWithRecipients ¶
EncryptFileWithRecipients is a convenience function for public key encryption
func FindLatestBackup ¶
FindLatestBackup finds the most recent backup file matching the pattern
func GetIdentityFilesFromEnv ¶
func GetIdentityFilesFromEnv() []string
GetIdentityFilesFromEnv retrieves identity file paths from environment variable
func GetPassphraseFromEnv ¶
func GetPassphraseFromEnv() string
GetPassphraseFromEnv retrieves passphrase from environment variable
func GetRecipientsFromEnv ¶
func GetRecipientsFromEnv() []string
GetRecipientsFromEnv retrieves recipients from environment variable
func IsEncrypted ¶
IsEncrypted checks if a file appears to be age-encrypted
func ReadAndConfirmPassphrase ¶
ReadAndConfirmPassphrase reads a passphrase twice and ensures they match
func ReadPassphrase ¶
ReadPassphrase reads a passphrase from stdin without echoing
func ReadPassphraseForDecryption ¶
ReadPassphraseForDecryption reads a passphrase for decryption
func ValidatePassphrase ¶
ValidatePassphrase checks if a passphrase meets minimum requirements
Types ¶
type DecryptOptions ¶
type DecryptOptions struct {
Passphrase string // Passphrase for symmetric decryption
IdentityFiles []string // Paths to age identity files (private keys)
}
DecryptOptions contains decryption configuration
type EncryptOptions ¶
type EncryptOptions struct {
Passphrase string // Passphrase for symmetric encryption
Recipients []string // Age recipient public keys for asymmetric encryption
}
EncryptOptions contains encryption configuration