Documentation ¶
Index ¶
- Constants
- func Decrypt(_ context.Context, ciphertext []byte, identities ...age.Identity) ([]byte, error)
- func DecryptAll(ctx context.Context, f billy.Filesystem, path string, ...) error
- func DecryptFile(ctx context.Context, f billy.Filesystem, path string, ...) error
- func Encrypt(_ context.Context, plaintext []byte, recipients ...age.Recipient) ([]byte, error)
- func EncryptAll(ctx context.Context, f billy.Filesystem, path string, ...) error
- func EncryptFile(ctx context.Context, f billy.Filesystem, path string, ...) error
- func Init(ctx context.Context, f billy.Filesystem, path string, recipients ...string) error
- func Register(ctx context.Context, f billy.Filesystem, path string, recipients ...string) error
- func Unregister(ctx context.Context, f billy.Filesystem, path string, recipients ...string) error
Constants ¶
const (
Ext = ".age"
)
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
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 ¶
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.
Types ¶
This section is empty.