Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadKeyfile ¶
ReadKeyfile reads the passphrase from a keyfile, validating file permissions. Returns the passphrase with trailing whitespace trimmed.
func ReadStdinPipe ¶
ReadStdinPipe reads a single line from non-terminal stdin. Returns an error if the line is empty after trimming.
func ShredKeyfile ¶
ShredKeyfile overwrites the keyfile content with zeros, syncs to disk, and removes it. Returns nil if the file does not exist (idempotent).
func ValidatePermissions ¶
ValidatePermissions checks that the file has exactly 0600 permissions.
func WriteKeyfile ¶
WriteKeyfile creates a keyfile with 0600 permissions. Parent directories are created with 0700 permissions if needed.
Types ¶
type Options ¶
type Options struct {
KeyfilePath string // default: ~/.lango/keyfile
AllowCreation bool // if true, prompt for confirmation on new passphrase
KeyringProvider keyring.Provider // if non-nil, try secure keyring first (biometric/TPM)
}
Options configures passphrase acquisition behavior.
Click to show internal directories.
Click to hide internal directories.