crypto

package
v0.0.365 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: Apache-2.0 Imports: 14 Imported by: 691

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertPoolFromPEM

func CertPoolFromPEM(pemCerts []byte) (*x509.CertPool, error)

func NewDigest

func NewDigest(algorithm Algorithm, digest string) digestImpl

func NewUnknownAlgorithm

func NewUnknownAlgorithm(name string) unknownAlgorithmImpl

Types

type Algorithm

type Algorithm interface {
	CreateDigest(io.Reader) (Digest, error)
	Name() string
}
var (
	DigestAlgorithmSHA1   Algorithm = algorithmSHAImpl{"sha1"}
	DigestAlgorithmSHA256 Algorithm = algorithmSHAImpl{"sha256"}
	DigestAlgorithmSHA512 Algorithm = algorithmSHAImpl{"sha512"}
)

type ArchiveDigestFilePathReader

type ArchiveDigestFilePathReader interface {
	OpenFile(path string, flag int, perm os.FileMode) (boshsys.File, error)
}

type Digest

type Digest interface {
	Verify(io.Reader) error
	VerifyFilePath(filePath string, fs boshsys.FileSystem) error
	Algorithm() Algorithm
	String() string
}

type MultipleDigest

type MultipleDigest struct {
	// contains filtered or unexported fields
}

func MustNewMultipleDigest

func MustNewMultipleDigest(digests ...Digest) MultipleDigest

func MustParseMultipleDigest

func MustParseMultipleDigest(json string) MultipleDigest

func NewMultipleDigest

func NewMultipleDigest(stream io.ReadSeeker, algos []Algorithm) (MultipleDigest, error)

func NewMultipleDigestFromPath

func NewMultipleDigestFromPath(filePath string, fs boshsys.FileSystem, algos []Algorithm) (MultipleDigest, error)

func ParseMultipleDigest

func ParseMultipleDigest(json string) (MultipleDigest, error)

func (MultipleDigest) Algorithm

func (m MultipleDigest) Algorithm() Algorithm

func (*MultipleDigest) DigestFor

func (m *MultipleDigest) DigestFor(algo Algorithm) (Digest, error)

func (MultipleDigest) MarshalJSON

func (m MultipleDigest) MarshalJSON() ([]byte, error)

func (MultipleDigest) String

func (m MultipleDigest) String() string

func (*MultipleDigest) UnmarshalJSON

func (m *MultipleDigest) UnmarshalJSON(data []byte) error

func (MultipleDigest) Verify

func (m MultipleDigest) Verify(reader io.Reader) error

func (MultipleDigest) VerifyFilePath

func (m MultipleDigest) VerifyFilePath(filePath string, fs boshsys.FileSystem) error

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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