Documentation
¶
Index ¶
- Constants
- func AppendToFile(src string, dest string)
- func CalculateMD5(path string) []byte
- func CalculateSha256(path string) []byte
- func Check(err error)
- func CreateAppImage(appDirPath string, appImageEnginePath string, pgp *PGPMaterial)
- func CreateSquashFSFromFolder(srcFolder string, outputFileName string) string
- func DirSize(path string) (int64, error)
- func DownloadAppImageEngine(arch string) string
- func GenerateSigningKey(name string, email string, passphrase string) (secretKey string, publicKey string, err error)
- func MakeExecutable(path string) error
- func OverwriteSection(path string, section string, content []byte) error
- func SignSha256(hash []byte, pgp PGPMaterial) ([]byte, error)
- func UpdateMD5(path string, hash []byte) error
- func UpdateSha256(path string, hash []byte) error
- func UpdateSigKey(path string, pgp PGPMaterial) error
- type PGPMaterial
Constants ¶
const DOWNLOAD_URL = "https://github.com/AppImage/type2-runtime/releases/download/continuous"
Download location of the AppImage engine binaries.
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
Appends the source file to the destination file.
func CalculateMD5 ¶
Calculates the MD5 hash over the complete .AppImage executable. Conforms to the AppImage spec.
func CalculateSha256 ¶
Calculates a sha256 hash from a given file. Hashes the entire content.
func CreateAppImage ¶
func CreateAppImage(appDirPath string, appImageEnginePath string, pgp *PGPMaterial)
Creates an app image from an AppDir.
appDirPath = directory which you want to turn into an AppImage. Make sure that it follows the AppImage spec.
appImageEnginePath = file of the AppImage engine. Use `DownloadAppImageEngine` function if you don't have an AppImage Engine ready yet.
pgp = The pgp key to sign the AppImage. It's optional. If you don't want to sign your AppImage, supply an empty struct.
func CreateSquashFSFromFolder ¶
Creates a squashfs file from a supplied folder and saves it to `outputFileName`
func DownloadAppImageEngine ¶
Downloads the AppImage Engine from the official source and returns the location of the downloaded file.
func GenerateSigningKey ¶
func GenerateSigningKey(name string, email string, passphrase string) (secretKey string, publicKey string, err error)
Creates a pgp key pair using RSA 4096 bit encryption. The armored public key and private key are written to two separate files called public.asc and private.asc.
func MakeExecutable ¶
Sets the permission bits for the given file to 755.
func OverwriteSection ¶
Used to overwrite sections of elf files.
Path is the location of the elf file. Section is the name of the section you want to overwrite (e.g. .sign_key) Content is what you want to write into the section
func SignSha256 ¶
func SignSha256(hash []byte, pgp PGPMaterial) ([]byte, error)
Signs the byte array using the supplied private key.
func UpdateSha256 ¶
Overwrites the .sha256_sig section in the AppImage Engine elf binary.
func UpdateSigKey ¶
func UpdateSigKey(path string, pgp PGPMaterial) error
Updates the .AppImage elf binary by writing the public key into the .sig_key field.