A web-based GPG key management utility that provides an intuitive interface for managing PGP keys, including generation, import/export, and deletion of both public and secret keys.
- 🔑 Generate new PGP key pairs with customizable parameters
- 📥 Import existing PGP keys
- 📤 Export public and secret keys
- 🗑️ Securely delete keys (passphrase required for secret keys)
- 🔍 View all available public and secret keys
- 🛡️ Secure key storage with proper GnuPG integration
- 🐳 Docker container for easy deployment
- Docker and Docker Compose
- Modern web browser
-
Run the following command:
cd TuxTechIaaC; docker-compose -f scripts/gpg_manager/gpg-key-manager.docker-compose.yml up -d
-
Access the web interface at
http://localhost:5000/http://<ip-addr>:5000
- Click on "Generate New Key"
- Fill in the required details (Name, Email, Passphrase)
- Optionally customize key type, length, and expiration
- Click "Generate"
- Locate the key in the key list
- Click the "Export" button next to the key
- The key will be downloaded as an ASCII-armored (.asc) file
- Public Keys: Gets auto-deleted once the associated Secret Key is deleted.
- Secret Keys:
- Click "Delete"
- Enter the key's passphrase when prompted
- Confirm deletion
You can access the running container using the following command:
docker exec -it gpg-manager /bin/bashOnce inside the container, you can use standard GnuPG commands to manage keys:
-
List all public keys:
gpg --list-keys
-
List all secret keys:
gpg --list-secret-keys
-
Export a public key:
gpg --armor --export KEY_ID > public_key.asc -
Export a secret key:
# For GnuPG 2.1+ (with passphrase prompt): gpg --armor --export-secret-keys KEY_ID > private-gpg-key.asc # For automated scripts (not recommended for security): # gpg --batch --pinentry-mode loopback --passphrase "your_passphrase" --armor --export-secret-keys KEY_ID > private-gpg-key.asc
Note: The first command will prompt for your passphrase. For automated environments, you can use the second command with
--batchand--passphrase, but be aware this is less secure as it exposes your passphrase in the command history. -
Import a key:
gpg --import key_file.asc
-
Delete a public key:
gpg --delete-key KEY_ID
-
Delete a secret key:
gpg --delete-secret-key KEY_ID
You can also run GPG commands directly from the host without entering the container:
# List keys
docker exec gpg-manager gpg --list-keys
# Export a key
docker exec gpg-manager gpg --armor --export KEY_ID > public_key.asc
# Import a key
docker cp your_key.asc gpg-manager:/tmp/your_key.asc
docker exec gpg-manager gpg --import /tmp/your_key.ascTo monitor the application logs:
docker logs -f gpg-manager- All keys are stored in a Docker volume (
gpg_data) - Secret key operations require the key's passphrase
- The web interface runs in production mode with secure defaults
- For production use, consider adding HTTPS and authentication
This project is part of the TuxTechIaaC suite and is licensed under the MIT License.