digest

package
v0.0.0-...-8223eb1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyDir

func VerifyDir(root string, digest map[string]string) error

Walks an entire file tree and takes the sha256sum of every file, comparing it to a digest containing all the expected sha256sums. If any file's hash does not match, or if there are files missing (from the digest or the tree), an error is returned.

Types

type Digest

type Digest struct {
	// A map of file path -> hash
	FileHashes map[string]string
	// contains filtered or unexported fields
}

func Parse

func Parse(digestReader, signatureReader io.Reader) (Digest, error)

Parses a sha256sum digest. Each line is a 64-character sha256 hash in lowercase hexadecimal, followed by a space, followed by an unused mode character, followed by a filename. The signature is optional.

func ParseUris

func ParseUris(
	fetcher uri.Fetcher,
	digestUri *url.URL,
	signatureUri *url.URL,
) (Digest, error)

Parses a sha256sum digest at the given digest URI, with a detached PGP signature at the given signature URI. If the pod manifest does not declare a signature path, use "".

func (Digest) SignatureData

func (digest Digest) SignatureData() (plaintext, signature []byte)

func (Digest) VerifyDir

func (digest Digest) VerifyDir(root string) error

Jump to

Keyboard shortcuts

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