Documentation
¶
Index ¶
- func Decrypt(ciphertext []byte, identity age.Identity) ([]byte, error)
- func DecryptWithPassphrase(ciphertext []byte, passphrase string) ([]byte, error)
- func DeleteKey() error
- func Encrypt(plaintext []byte, recipient age.Recipient) ([]byte, error)
- func EncryptWithPassphrase(plaintext []byte, passphrase string) ([]byte, error)
- func GenerateKey() (*age.X25519Identity, error)
- func LoadKey() (*age.X25519Identity, string, error)
- func LoadPublicKey() (*age.X25519Recipient, string, error)
- func ParseIdentity(secretKey string) (*age.X25519Identity, error)
- func ParseRecipient(publicKey string) (*age.X25519Recipient, error)
- func ShredFile(path string) error
- func StoreKey(identity *age.X25519Identity) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptWithPassphrase ¶
DecryptWithPassphrase decrypts data encrypted with a passphrase.
func EncryptWithPassphrase ¶
EncryptWithPassphrase encrypts data using a passphrase (for key backup).
func GenerateKey ¶
func GenerateKey() (*age.X25519Identity, error)
GenerateKey creates a new age X25519 identity (keypair).
func LoadKey ¶
func LoadKey() (*age.X25519Identity, string, error)
LoadKey retrieves the age private key, trying (in order): 1. ENCLAUDE_KEY environment variable 2. OS keychain Returns the identity and the source it was loaded from.
func LoadPublicKey ¶
func LoadPublicKey() (*age.X25519Recipient, string, error)
LoadPublicKey loads just the public key (for encryption-only operations like seal).
func ParseIdentity ¶
func ParseIdentity(secretKey string) (*age.X25519Identity, error)
ParseIdentity parses an age secret key string into an Identity.
func ParseRecipient ¶
func ParseRecipient(publicKey string) (*age.X25519Recipient, error)
ParseRecipient parses an age public key string into a Recipient.
func ShredFile ¶
ShredFile overwrites a file with random data before deleting it. This provides better-than-nothing protection on HDDs. On SSDs with TRIM, this is less effective but still removes the plaintext file.
func StoreKey ¶
func StoreKey(identity *age.X25519Identity) error
StoreKey saves the age private key to the OS keychain.
Types ¶
This section is empty.