encryption

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptDir

func DecryptDir(dirPath, newDirPath, pathToPublicKey, pathToPrivateKey, password string) error

DecryptDir takes the path to an encrypted directory and decrypts it using the private key specified. It will write the decrypted directory to newDirPath.

pgp -> gzip -> tar

func EncryptDir

func EncryptDir(dirPath, newDirPath, pathToPublicKey string) error

EncryptDir takes the path to a directory an encrypts it using the public key specified. It will write out an encrypted file to newDirPath.

gzip -> tar -> pgp

func GetPassword

func GetPassword() (string, error)

GetPassword prompts a user for a password.

Types

type ErrPrivateKeyDecryptionFailed

type ErrPrivateKeyDecryptionFailed struct {
	PathToPrivateKey string
	Err              error
}

ErrPrivateKeyDecryptionFailed occurs when the private key cannot be encrypted. This error is normally the fault of the user and means that the program should ask for the password again.

func (ErrPrivateKeyDecryptionFailed) Error

Error returns the error message.

Jump to

Keyboard shortcuts

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