Documentation
¶
Index ¶
- func CalcChecksums(reader io.Reader, checksumType ...Algorithm) (map[Algorithm]string, error)
- func CalcChecksumsBytes(reader io.Reader, checksumType ...Algorithm) (map[Algorithm][]byte, error)
- func Decrypt(formattedCipherText, key, keyId string) (string, error)
- func Encrypt(text, key, keyId string) (string, error)
- func GenerateKeyId(key string) (string, error)
- func GenerateRandomKeyString(keySize int) (string, error)
- func GetFileChecksums(filePath string, checksumType ...Algorithm) (checksums map[Algorithm]string, err error)
- func IsTextEncrypted(formattedCipherText, key, keyId string) (bool, error)
- type Algorithm
- type Checksum
- type FileDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcChecksums ¶ added in v1.7.3
CalcChecksums calculates all hashes at once using AsyncMultiWriter. The file is therefore read only once.
func CalcChecksumsBytes ¶ added in v1.7.3
CalcChecksumsBytes calculates hashes like `CalcChecksums`, returns result as bytes
func Encrypt ¶
format encrypted text , keyId is first 6 chars of hashed(sha256) signing key {{key-id}}${{algo}}${{encrypted-value}} example: e67gef$aes256$adsad321424324fdsdfs3Rddi90oP34xV
func GenerateKeyId ¶
keyId is first 6 chars of hashed(sha256) signing key
func GenerateRandomKeyString ¶
func GetFileChecksums ¶ added in v1.7.3
func IsTextEncrypted ¶
Types ¶
type Checksum ¶ added in v1.7.3
type Checksum struct {
Sha1 string `json:"sha1,omitempty"`
Md5 string `json:"md5,omitempty"`
Sha256 string `json:"sha256,omitempty"`
}
func CalcChecksumDetails ¶ added in v1.7.3
type FileDetails ¶ added in v1.7.3
func GetFileDetails ¶ added in v1.7.3
func GetFileDetails(filePath string, includeChecksums bool) (details *FileDetails, err error)
Click to show internal directories.
Click to hide internal directories.