crypto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertPoolFromPEM added in v0.1.0

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

func NewDigest

func NewDigest(algorithm Algorithm, digest string) digestImpl

func NewUnknownAlgorithm added in v0.0.10

func NewUnknownAlgorithm(name string) unknownAlgorithmImpl

Types

type Algorithm added in v0.0.10

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 added in v0.0.10

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 added in v0.0.4

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

func MustNewMultipleDigest added in v0.0.10

func MustNewMultipleDigest(digests ...Digest) MultipleDigest

func MustParseMultipleDigest added in v0.0.10

func MustParseMultipleDigest(json string) MultipleDigest

func NewMultipleDigest

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

func NewMultipleDigestFromPath added in v0.0.10

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

func ParseMultipleDigest added in v0.0.10

func ParseMultipleDigest(json string) (MultipleDigest, error)

func (MultipleDigest) Algorithm added in v0.0.10

func (m MultipleDigest) Algorithm() Algorithm

func (*MultipleDigest) DigestFor added in v0.0.10

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

func (MultipleDigest) MarshalJSON added in v0.0.10

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

func (MultipleDigest) String added in v0.0.10

func (m MultipleDigest) String() string

func (*MultipleDigest) UnmarshalJSON added in v0.0.10

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

func (MultipleDigest) Verify added in v0.0.10

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

func (MultipleDigest) VerifyFilePath added in v0.0.10

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