file

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 40 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

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

func IsJWT

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

func IsMixedPEM added in v0.7.0

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

func IsUUID

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

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

func Inspect

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

func JCEKeystore

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

func JWTData

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

func JavaKeystore

func JavaKeystore(info Info, data []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 RPMFile added in v0.6.0

func RPMFile(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

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

type JWT

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

func ParseJWT

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

func (JWT) HeaderAttributes

func (j JWT) HeaderAttributes() []Attribute

func (JWT) PayloadAttributes

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