encoding

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileASN1DER

func FileASN1DER(hashType HashType, hash []byte, mode, mask os.FileMode, sys *Sys) ([]byte, error)

func TreeASN1DER

func TreeASN1DER(hashType HashType, hashes []NamedHash) ([]byte, error)

Types

type HashType

type HashType asn1.Enumerated
const (
	HashNone HashType = iota

	// crypto
	HashMD4
	HashMD5
	HashSHA1
	HashSHA256
	HashSHA224
	HashSHA512
	HashSHA384
	HashSHA512_224
	HashSHA512_256
	HashSHA3_224
	HashSHA3_256
	HashSHA3_384
	HashSHA3_512
	HashBlake2s256
	HashBlake2b256
	HashBlake2b384
	HashBlake2b512
	HashRMD160

	// non-crypto
	HashCRC32
	HashCRC32c
	HashCRC32k
	HashCRC64ISO
	HashCRC64ECMA
	HashAdler32
	HashFNV32
	HashFNV32a
	HashFNV64
	HashFNV64a
	HashFNV128
	HashFNV128a

	HashUnknown HashType = -1
)

type NamedHash

type NamedHash struct {
	Hash []byte
	Name []byte `asn1:"omitempty"`
}

type Sys

type Sys struct {
	UID, GID      *uint32
	Mtime, Ctime  *Timespec
	Rdev          *uint64
	XattrHashType HashType
	XattrHashes   []NamedHash
}

type Timespec

type Timespec struct {
	Sec  int64
	Nsec int64
}

Jump to

Keyboard shortcuts

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