在 CentOS(或其他 Linux 发行版)下对 AppImage 进行“签名”,通常指 AppImage 官方支持的 GPG 签名机制,而不是代码签名证书(如 Windows/macOS)。下面按实用流程说明。
AppImage 本身支持:
appimagetool / AppImageLauncher 校验⚠️ 注意:
sudo yum install -y gpg squashfs-tools
如需最新 appimagetool:
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
gpg --full-generate-key
选择:
查看密钥:
gpg --list-secret-keys
结构示例:
MyApp.AppDir/
├── AppRun
├── myapp.desktop
├── myapp.png
└── usr/bin/myapp
appimagetool MyApp.AppDir MyApp-x86_64.AppImage
gpg --output MyApp-x86_64.AppImage.sig \
--detach-sign MyApp-x86_64.AppImage
生成:
MyApp-x86_64.AppImageMyApp-x86_64.AppImage.sig✅ 这是 AppImage 官方支持的签名方式
appimagetool --sign --sign-key your@email.com MyApp.AppDir
或:
export APP_IMAGE_SIGN_KEY=your@email.com
appimagetool MyApp.AppDir
签名会嵌入 AppImage 内部。
gpg --verify MyApp-x86_64.AppImage.sig MyApp-x86_64.AppImage
appimagetool --appimage-extract-and-run MyApp-x86_64.AppImage
# 或
./MyApp-x86_64.AppImage --appimage-signature
gpg --export -a your@email.com > pubkey.asc
gpg --import pubkey.asc
❌ 不能,Linux AppImage 不支持
默认 不强制,用户需手动验证
✅ 可以,使用 GPG 私钥(推荐 gpg --batch)
✅ CentOS 下 AppImage 签名 = GPG 签名
✅ 推荐方式:gpg --detach-sign
✅ 可嵌入:appimagetool --sign
如果你需要:
可以告诉我你的使用场景。