gitage

package module
v0.0.0-...-1d70491 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

README

Gitage GoDoc Test

Git+age = Gitage; simple, modern and secure Git encryption tool

Gitage is a CLI tool that can be used as a wrapper of Git CLI.

It uses age encryption tool to encrypt files before committing them to the repository.

Credits

This project relies on age, thanks to Filippo Valsorda.

It also relies on go-git and its file-system abstraction billy, so thanks to their contributors as well.

Documentation

Index

Constants

View Source
const (
	Ext = ".age"
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(_ context.Context, ciphertext []byte, identities ...age.Identity) ([]byte, error)

Decrypt decrypts the given ciphertext using the given recipients and 'age' encryption tool (Go library).

func DecryptAll

func DecryptAll(ctx context.Context, f billy.Filesystem, path string, identities ...age.Identity) error

DecryptAll decrypts all files in the specified path, so it is equivalent to calling DecryptFile for each file in the given path, recursively.

It skips directories (files are decrypted individually) and non-encrypted files (files without the .age extension) to avoid double decryption.

Arguments: - path: must be an absolute path.

func DecryptFile

func DecryptFile(ctx context.Context, f billy.Filesystem, path string, identities ...age.Identity) error

DecryptFile decrypts the file present at the given path, within the given file-system, using the given identities.

In comparison to Decrypt, it replaces the ciphered file with the decrypted one (w/out the .age extension).

So, assuming it can be called with a non-transactional file-system, use it with care. An unsuccessful operation will leave the file-system in an inconsistent state.

Arguments: - path: must be an absolute path.

func Encrypt

func Encrypt(_ context.Context, plaintext []byte, recipients ...age.Recipient) ([]byte, error)

Encrypt encrypts the given plaintext using the given recipients and 'age' encryption tool (Go library).

func EncryptAll

func EncryptAll(ctx context.Context, f billy.Filesystem, path string, recipients ...age.Recipient) error

EncryptAll encrypts all files in the specified path, so it is equivalent to calling EncryptFile for each file in the given path, recursively.

It skips directories (files are encrypted individually) and encrypted files (files with the .age extension) to avoid double encryption.

Arguments: - path: must be an absolute path.

func EncryptFile

func EncryptFile(ctx context.Context, f billy.Filesystem, path string, recipients ...age.Recipient) error

EncryptFile encrypts the file present at the given path, within the given file-system, using the given recipients.

In comparison to Encrypt, it replaces the plain file with the encrypted one (with the .age extension).

So, assuming it can be called with a non-transactional file-system, use it with care. An unsuccessful operation will leave the file-system in an inconsistent state.

Arguments: - path: must be an absolute path.

func Init

func Init(ctx context.Context, f billy.Filesystem, path string, recipients ...string) error

Init docs (TODO) - path MUST be an absolute path.

func Register

func Register(ctx context.Context, f billy.Filesystem, path string, recipients ...string) error

Register docs (TODO) - path MUST be an absolute path.

func Unregister

func Unregister(ctx context.Context, f billy.Filesystem, path string, recipients ...string) error

Unregister docs (TODO) - path MUST be an absolute path.

Types

This section is empty.

Directories

Path Synopsis
cmd
internal
fs
log

Jump to

Keyboard shortcuts

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