fcrypt

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptFile

func DecryptFile(inputPath, outputPath string, identity age.Identity) (err error)

DecryptFile decrypts a file leaving the original. It writes to a temporary file first and renames on success to avoid leaving a partially-written output file on failure.

func DecryptInPlace

func DecryptInPlace(filepath string, privatekey age.Identity) error

DecryptInPlace takes in a file that is assumed to be encrypted and replaces that file with a version that is decrypted in-place. The file left in place is created as <name>.<ext> with the suffix .age now removed from the filename

func DecryptReader

func DecryptReader(r io.Reader, w io.Writer, identity age.Identity) error

DecryptReader decrypts data from an io.Reader and writes the decrypted result to an io.Writer

func EncryptFile

func EncryptFile(inputPath, outputPath string, recipients []age.Recipient) (err error)

EncryptFile encrypts a file in place removing the original version. It writes to a temporary file first and renames on success to avoid leaving a partially-written output file on failure.

func EncryptInPlace

func EncryptInPlace(filepath string, recipients []age.Recipient) error

EncryptInPlace takes a filepath <name>.<ext>. This file is then replaced with an encrypted version with a new file <name>.<ext>.age. The old file is removed without confirmation and cannot be recovered.

func EncryptReader

func EncryptReader(r io.Reader, w io.Writer, recipients []age.Recipient) error

EncryptReader encrypts data from an io.Reader and writes the encrypted result to an io.Writer

func LoadPrivateKey

func LoadPrivateKey(key string) (*age.X25519Identity, error)

func LoadPublicKey

func LoadPublicKey(key string) (*age.X25519Recipient, error)

func LoadPublicKeys added in v0.6.0

func LoadPublicKeys(keys []string) ([]age.Recipient, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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