pkg

package
v0.0.0-...-c8b13a4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidContentFolder = errors.New("invalid content folder")
	ErrorInvalidSetupFile     = errors.New("invalid setup file")
)

Functions

func ValidateHMAC

func ValidateHMAC(r io.Reader, h func() hash.Hash, key, suppliedMAC []byte) (bool, error)

ValidateMAC validates check if the HMAC generated with the data read through r matches the hash passed to the function. If they match it returns (true, nil) otherwise it returns (false, nil)

Types

type AESCBCDecrypter

type AESCBCDecrypter struct {
	Block     cipher.Block
	BlockMode cipher.BlockMode
	// contains filtered or unexported fields
}

func NewAESCBCDecrypter

func NewAESCBCDecrypter(w io.Writer, iv, aesKey []byte) (*AESCBCDecrypter, error)

func (AESCBCDecrypter) Write

func (bw AESCBCDecrypter) Write(b []byte) (int, error)

type AESCBCEncrypter

type AESCBCEncrypter struct {
	Block     cipher.Block
	BlockMode cipher.BlockMode
	// contains filtered or unexported fields
}

func NewAESCBCEncrypter

func NewAESCBCEncrypter(w io.Writer, h func() hash.Hash, iv, aesKey, macKey []byte) (*AESCBCEncrypter, error)

func (AESCBCEncrypter) Sum

func (bw AESCBCEncrypter) Sum(b []byte) []byte

func (AESCBCEncrypter) Write

func (bw AESCBCEncrypter) Write(b []byte) (int, error)

type Intunewin

type Intunewin struct {
	Name string // The name of the intunewin file
	Path string // The path to the intunewin file
	// contains filtered or unexported fields
}

func NewIntunewin

func NewIntunewin(name, contentPath, setupFile, outputPath string) (*Intunewin, error)

NewIntunewin creates a new intunewin file contentPath: The path to the content folder setupFile: The name of the setup file, relative to the content folder outputPath: The path to the output folder Returns a pointer to the new intunewin file

func OpenFile

func OpenFile(file string) (*Intunewin, error)

func (*Intunewin) Close

func (iw *Intunewin) Close() error

func (*Intunewin) EncryptContentArchive

func (iw *Intunewin) EncryptContentArchive(input io.Reader) (*os.File, []byte, error)

encryptContentArchive() encrypts the file

func (*Intunewin) ExtractContent

func (iw *Intunewin) ExtractContent() error

ExtractContent() writes the IntunePackage.intunewin to the path supplied in path

Jump to

Keyboard shortcuts

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