extract

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowJSON

func ShowJSON(path string, writer io.Writer) error

func ShowText

func ShowText(path string, writer io.Writer, hideVerboseData bool) error

Types

type Algorithm

type Algorithm struct {
	AlgorithmOID     string `json:"algorithmOID"`
	Base64Parameters string `json:"base64Parameters"`
}

type AlgorithmWithValue

type AlgorithmWithValue struct {
	Base64 string `json:"base64"`
	Algorithm
}

func (AlgorithmWithValue) String

func (av AlgorithmWithValue) String() string

type Attribute

type Attribute struct {
	OID    string `json:"oid"`
	Base64 string `json:"base64"`
}

func (Attribute) String

func (a Attribute) String() string

type BlobDetails

type BlobDetails struct {
	Base64 string `json:"base64"`
	Digest Digest `json:"digest"`
}

type CMSValidationDetails

type CMSValidationDetails struct {
	IsValid      bool   `json:"isValid"`
	ErrorMessage string `json:"errorMessage"`
	// Error                error                   `json:"error"`
	VerifiedCertificates [][][]*x509.Certificate `json:"verifiedCertificates"`
}

type Certificate

type Certificate struct {
	PEM    string            `json:"pem"`
	Parsed *x509.Certificate `json:"parsed"`
}

func (Certificate) String

func (c Certificate) String() string

helpful for specific information on cert requirements https://images.apple.com/certificateauthority/pdf/Apple_Developer_ID_CPS_v3.3.pdf

type CodeDirectoryDetails

type CodeDirectoryDetails struct {
	Blob           BlobDetails     `json:"blob"`
	SpecialDigests []SectionDigest `json:"specialDigests"`
	Version        DescribedValue  `json:"version"`
	PageDigests    []SectionDigest `json:"pageDigests"`
	DeclaredDigest SectionDigest   `json:"declaredDigest"`
	TeamID         string          `json:"teamID"`
	ID             string          `json:"id"`
	Platform       uint8           `json:"platform"`
	Flags          DescribedValue  `json:"flags"`
}

func (CodeDirectoryDetails) String

func (c CodeDirectoryDetails) String(hideVerboseData bool) string

type DescribedValue

type DescribedValue struct {
	Value       interface{} `json:"value"`
	Description string      `json:"description"`
}

type Details

type Details struct {
	File MachoDetails `json:"file"`
	// TODO: raw superblob info
	SuperBlob *SuperBlobDetails `json:"superBlob,omitempty"`
}

func ParseDetails

func ParseDetails(m File) Details

func (Details) String

func (d Details) String(hideVerboseData bool) (r string)

type Digest

type Digest struct {
	Algorithm string `json:"algorithm"`
	Value     string `json:"value"`
}

type EntitlementDetails

type EntitlementDetails struct {
	Blob BlobDetails `json:"blob"`
}

type File

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

func NewFile

func NewFile(binPath string) ([]*File, error)

type MachoDetails

type MachoDetails struct {
	Magic            string   `json:"magic"`
	Type             string   `json:"type"`
	CPU              string   `json:"cpu"`
	SubCPU           string   `json:"subcpu"`
	Flags            []string `json:"flags"`
	Libs             []string `json:"libs"`
	LoadCommandCount uint32   `json:"loadCommandsCount"`
	LoadCommandSize  uint32   `json:"loadCommandSize"`
	UUID             string   `json:"uuid"`
}

func (MachoDetails) String

func (m MachoDetails) String() (r string)

type RequirementDetails

type RequirementDetails struct {
	Blob         BlobDetails         `json:"blob"`
	Requirements []types.Requirement `json:"requirements"`
}

func (RequirementDetails) String

func (r RequirementDetails) String() string

type SectionDigest

type SectionDigest struct {
	Index  int64  `json:"index"`
	Offset uint64 `json:"offset"`
	Digest
}

func (SectionDigest) String

func (d SectionDigest) String() string

type SignatureDetails

type SignatureDetails struct {
	Blob          BlobDetails          `json:"blob"`
	Base64        string               `json:"base64"`
	CMSValidation CMSValidationDetails `json:"cmsValidation"`
	Certificates  []Certificate        `json:"certificates"`
	Signers       []Signer             `json:"signers"`
}

func (SignatureDetails) String

func (s SignatureDetails) String() string

type Signer

type Signer struct {
	ID               string             `json:"id"`
	Signature        AlgorithmWithValue `json:"signature"`
	SignedAttributes []Attribute        `json:"signedAttributes"`
	DigestAlgorithm  Algorithm          `json:"digestAlgorithm"`
}

func (Signer) String

func (s Signer) String() string

type SuperBlobDetails

type SuperBlobDetails struct {
	Offset          uint32                 `json:"offset"`
	Size            uint32                 `json:"size"`
	CodeDirectories []CodeDirectoryDetails `json:"codeDirectories"`
	Requirements    []RequirementDetails   `json:"requirements"`
	Entitlements    []EntitlementDetails   `json:"entitlements"`
	Signatures      []SignatureDetails     `json:"signatures"`
}

Jump to

Keyboard shortcuts

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