Skip to content
Matt edited this page Nov 2, 2022 · 1 revision

GPG signing (for Gradle)

Exporting the key

Usually run in cmd:

gpg -a --export-secret-keys [keyId]

Encoding the key as Base64

Method 1:

online base64 encoder (want to avoid this for security reasons, so see next methods)

Method 2:

Bash:

cat <<EOF | base64 -w 0

Paste in the ascii-armored key, pressing enter to submit its last line as necessary.

EOF

Finally, type EOF by itself to end the here-doc.

Want to avoid this because it logs to .bash_history; see next method

Method 3:

VSCode:

  1. Paste in the ascii-armored key, making sure to include an empty line at the end of the text body before selecting all.
  2. Use the vscode-base64 Base64 Encode function via Ctrl+Shift+P->Base64 Encode or via the sequence Ctrl+E Ctrl+E.

Clone this wiki locally