cryptography

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hashes = [1]string{"sha256"}

Hashes is the list of supported Cryptographic Hash Functions used for the checksum feature

Functions

func GenerateChecksum

func GenerateChecksum(sourcePack, destinationDir, hashFunction string) error

GenerateChecksum creates a .checksum file for a pack.

func GenerateSignedChecksum added in v0.8.0

func GenerateSignedChecksum(packPath, keyPath, destinationDir, passphrase string, base64 bool) error

GenerateSignature creates a .signature file based on a pack

func GetDigestList added in v0.8.0

func GetDigestList(sourcePack, hashFunction string) (map[string]string, error)

GetDigestList computes the digests of a pack according to the specified hash function.

func VerifyChecksum

func VerifyChecksum(packPath, checksumPath string) error

VerifyChecksum validates the contents of a pack according to a provided .checksum file.

func VerifySignature added in v0.8.0

func VerifySignature(checksumPath, keyPath, signaturePath, passphrase string) error

VerifyChecksum validates a signed .checksum. Currently for demo purposes it validates the checksum file against its detached .signature and only accepts a private key, preferably created through "cpackget signature-create"

func WriteChecksumFile added in v0.8.0

func WriteChecksumFile(digests map[string]string, filename string) error

WriteChecksumFile takes the digests of a pack and writes it to a .checksum file on disk

Types

This section is empty.

Jump to

Keyboard shortcuts

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