Documentation ¶
Index ¶
- Variables
- func Encrypt(input []byte, entityList []*openpgp.Entity) ([]byte, error)
- func EncryptFile(inputFile *os.File, outputFile *os.File, entityList []*openpgp.Entity) (err error)
- func HashFileMD5(file *os.File) ([]byte, error)
- func HashFileSHA1(file *os.File) ([]byte, error)
- func HashFileSHA256(file *os.File) ([]byte, error)
- func HashFileSHA512(file *os.File) ([]byte, error)
- func HashMD5(filePath string) ([]byte, error)
- func HashSHA1(filePath string) ([]byte, error)
- func HashSHA256(filePath string) ([]byte, error)
- func HashSHA512(filePath string) ([]byte, error)
- func ReadPublicKey(key []byte) (*openpgp.Entity, error)
- func ReadPublicKeyFile(keyPath string) (*openpgp.Entity, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Encrypt ¶
Encrypt will encrypt a []byte with the To being the array of openpgp.Entities passed in. Encrypt uses a temporary file with the default of "/tmp/". If you need to modify this set cryptohelp.TempDir = "/your/path/here"
func EncryptFile ¶
Encrypt will encrypt a file on the filesystem and write to the outputFile with the To being the array of openpgp.Entities passed in.
func HashFileMD5 ¶
HashFileMD5 will obtain an MD5 hash of the *os.File passed. *os.File's Seek position will automatically be moved to Seek(0,0) and a best effort will be used to restore the file's position after obtaining the hash. It returns a []byte containing the hash. If setting the previous Seek() fails the HASH will be valid but an error ErrorSeekRestoreFailed will also be included.
func HashFileSHA1 ¶
HashFileSHA1 will obtain an SHA1 hash of the *os.File passed. *os.File's Seek position will automatically be moved to Seek(0,0) and a best effort will be used to restore the file's position after obtaining the hash. It returns a []byte containing the hash. If setting the previous Seek() fails the HASH will be valid but an error may also be returned.
func HashFileSHA256 ¶
HashFileSHA256 will obtain an SHA256 hash of the *os.File passed. *os.File's Seek position will automatically be moved to Seek(0,0) and a best effort will be used to restore the file's position after obtaining the hash. It returns a []byte containing the hash. If setting the previous Seek() fails the HASH will be valid but an error ErrorSeekRestoreFailed will also be included.
func HashFileSHA512 ¶
HashFileSHA512 will obtain an SHA512 hash of the *os.File passed. *os.File's Seek position will automatically be moved to Seek(0,0) and a best effort will be used to restore the file's position after obtaining the hash. It returns a []byte containing the hash. If setting the previous Seek() fails the HASH will be valid but an error ErrorSeekRestoreFailed will also be included.
func HashMD5 ¶
HashMD5 returns MD5 hash for the file at the given path The returned hash is a byte array.
func HashSHA1 ¶
HashSHA1 returns SHA1 hash for the file at the given path The returned hash is a byte array.
func HashSHA256 ¶
Hash256 returns SHA256 hash for the file at the given path The returned hash is a byte array.
func HashSHA512 ¶
Hash512 returns SHA512 hash for the file at the given path The returned hash is a byte array.
func ReadPublicKey ¶
ReadPublicKey will convert a []byte into an *openpgp.Entity
Types ¶
This section is empty.