add gpg public_key ipmort
This commit is contained in:
51
gpg_setup.sh
Executable file
51
gpg_setup.sh
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "🔐 GPG Setup für lxtools_installer"
|
||||
echo "=================================="
|
||||
|
||||
# Check if GPG is installed
|
||||
if ! command -v gpg &> /dev/null; then
|
||||
echo "❌ GPG ist nicht installiert"
|
||||
echo "Installation: sudo apt install gnupg"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if GPG key exists
|
||||
if ! gpg --list-secret-keys | grep -q "sec"; then
|
||||
echo "📋 Kein GPG-Schlüssel gefunden. Erstelle einen neuen..."
|
||||
echo "Verwende diese Einstellungen:"
|
||||
echo "- Typ: RSA"
|
||||
echo "- Größe: 4096"
|
||||
echo "- Gültigkeitsdauer: 2y (2 Jahre)"
|
||||
echo "- Email: deine@email.com"
|
||||
echo ""
|
||||
gpg --full-generate-key
|
||||
else
|
||||
echo "✅ GPG-Schlüssel bereits vorhanden"
|
||||
fi
|
||||
|
||||
# List available keys
|
||||
echo ""
|
||||
echo "📋 Verfügbare Schlüssel:"
|
||||
gpg --list-secret-keys --keyid-format SHORT
|
||||
|
||||
# Ask for key selection
|
||||
echo ""
|
||||
read -p "Welchen Key-ID möchtest du verwenden? (oder Enter für Standard): " KEY_ID
|
||||
|
||||
if [ -z "$KEY_ID" ]; then
|
||||
# Use first available key
|
||||
KEY_ID=$(gpg --list-secret-keys --keyid-format SHORT | grep "sec" | head -1 | sed 's/.*\///' | cut -d' ' -f1)
|
||||
fi
|
||||
|
||||
echo "🔑 Verwende Key-ID: $KEY_ID"
|
||||
|
||||
# Export public key
|
||||
gpg --export --armor "$KEY_ID" > public_key.asc
|
||||
|
||||
echo "✅ Öffentlicher Schlüssel exportiert: public_key.asc"
|
||||
echo ""
|
||||
echo "📋 Nächste Schritte:"
|
||||
echo "1. Committen Sie public_key.asc ins Repository"
|
||||
echo "2. Testen Sie den Build mit: ./build_compatible.sh"
|
||||
echo "3. Verifizieren Sie die Signatur mit: gpg --verify file.asc file"
|
Reference in New Issue
Block a user