file

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRegularFile = errors.New("only regular files are supported")
View Source
var MaxReadSize = 128 * units.Megabyte
View Source
var UnknownASN1Data = Info{Description: "unknown ASN.1 data"}
View Source
var UnknownPEMData = Info{Description: "unknown PEM data"}

Functions

func IsASN1

func IsASN1(_ string, data []byte, _ int64) bool

func IsBase64ASN1 added in v0.4.0

func IsBase64ASN1(_ string, data []byte, _ int64) bool

func IsJWT added in v0.4.0

func IsJWT(_ string, data []byte, _ int64) bool

func IsUUID added in v0.4.0

func IsUUID(_ string, data []byte, _ int64) bool

Types

type Attribute

type Attribute struct {
	Name  string
	Value string
}

type Identifier

type Identifier func(name string, data []byte, fileSize int64) bool

type Info

type Info struct {
	Path        string
	Size        int64
	Description string
	Attributes  []Attribute
	Children    []Info
}

func ASN1File

func ASN1File(info Info, data []byte) (Info, error)

func Base64ASN1File added in v0.4.0

func Base64ASN1File(info Info, data []byte) (Info, error)

func Inspect

func Inspect(f *os.File) (Info, error)

func JCEKeystore

func JCEKeystore(info Info, _ []byte) (Info, error)

func JWTData added in v0.4.0

func JWTData(info Info, data []byte) (Info, error)

func JavaKeystore

func JavaKeystore(info Info, _ []byte) (Info, error)

func PEMFile

func PEMFile(info Info, data []byte) (Info, error)

func PGPPrivateKey

func PGPPrivateKey(info Info, data []byte) (Info, error)

func PGPPublicKey

func PGPPublicKey(info Info, data []byte) (Info, error)

func PuttyPPK

func PuttyPPK(info Info, data []byte) (Info, error)

func SSH1PrivateKey

func SSH1PrivateKey(info Info, data []byte) (Info, error)

func SSHAuthorizedKeys

func SSHAuthorizedKeys(info Info, data []byte) (Info, error)

func SSHKnownHosts

func SSHKnownHosts(info Info, data []byte) (Info, error)

func SSHPublicKey

func SSHPublicKey(info Info, data []byte) (Info, error)

func UUIDValue added in v0.4.0

func UUIDValue(info Info, data []byte) (Info, error)

type JWT added in v0.4.0

type JWT struct {
	Header    map[string]any
	Payload   map[string]any
	Signature []byte
}

func ParseJWT added in v0.4.0

func ParseJWT(data []byte) (*JWT, error)

func (JWT) HeaderAttributes added in v0.4.0

func (j JWT) HeaderAttributes() []Attribute

func (JWT) PayloadAttributes added in v0.4.0

func (j JWT) PayloadAttributes() []Attribute

type Parser

type Parser func(info Info, data []byte) (Info, error)

Jump to

Keyboard shortcuts

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