Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>GnuPG-ToolNew to Visual Studio Code? Get it now.
GnuPG-Tool

GnuPG-Tool

J. Heilingbrunner

|
45,796 installs
| (4) | Free
Tool for a simple usage of GnuPG
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GnuPG Tool

GnuPG Tool logo

GitHub license

What's new in GnuPG-Tool

  • bugfix to check keyring location, which caused 'GnuPG not available' message
  • security update

Features

  • Supports GnuPG v1.4, v2.2, v2.3 and v2.4
  • Check GnuPG availability/version.
  • Encryption for multiple recipients or with simple passphrase
  • Encrypt/decrypt text or file to text, file or preview
  • Passphrase/Pin entry only into original GnuPG Pinentry dialog. Not through Visual Studio Code or something else.
  • End session to reset password cache by killing gpg-agent.
  • Works with smartcards.
  • Sign/verify file.
  • Keys generate/edit/delete/import/export.
  • Detects local/alternated homedir/key ring
  • Code folding for BEGIN PGP .../END PGP ... blocks
  • README.md with links to github wiki

Supported locales

The extension is available in multiple languages (Google Translator):

  • de
  • en
  • es
  • fr
  • ru
  • zh-CN

Decrypt-Selection

The command palette ...

Command palette

Available commands:

  • Check GnuPG
  • Copy Fingerprint To Clipboard
  • Copy KeyId To Clipboard
  • Decrypt ... (opens sub menu)
  • Decrypt File
  • Decrypt Preview
  • Decrypt Selection
  • Delete Public Key
  • Delete Secret Key
  • Edit Public Key (via Terminal)
  • Encrypt ... (opens sub menu)
  • Encrypt File w/ Recipients
  • Encrypt File w/ Passphrase
  • Encrypt Preview w/ Recipients
  • Encrypt Preview w/ Passphrase
  • Encrypt Selection w/ Recipients
  • Encrypt Selection w/ Passphrase
  • End Session
  • Environment ... (opens sub menu)
  • Export Public Keys
  • Export Secret Keys
  • Export Secret Sub-Keys
  • Generate Key (via Terminal)
  • Import Keys
  • Keys ... (opens sub menu)
  • List Public Keys
  • List Secret Keys
  • Show Smartcard
  • Sign File (detach-sign)
  • Sign File (clear-sign)
  • Trust ... (opens sub menu)
  • Verify File

The explorer context menu ...

Explorer context menu

The editor context menu ...

Editor context menu

Used References

  • VSCode GPG extension by Jose Valecillos
  • node-gpg by Nicholas Penree
  • GNU Privacy Guard
  • GnuPG documentation

Usage

Used File extensions

The *.asc Files

  • <filename>.<ext>.asc: This should be an ascii encrypted file (option: --armor) of the <filename>.<ext> file.
  • It although can be an ascii encoded key file.

The *.sig Files

  • <filename>.<ext>.sig: This should be an ascii encoded signature file corresponding to <filename>.<ext>.

The *.key Files

  • <filename>.key: This should be an ascii encrypted key (option: --armor)

The Clipboard

This extension uses simple command line tools to copy content (commands, fingerprints, key ids) to the clipboard.

  • Windows: CLIP
  • MacOS: PBCOPY
  • Linux: XCLIP

Support for an alternate homedir/key ring

When VSCode is opened in a folder with (file:pubring.kbx OR file:pubring.gpg) AND (folder:private-keys-v1.d OR file:secring.gpg) included, then the --homedir parameter is used in every command of this VSCode instance. Additionally the extension supports a workspace configuration to set the path for the keyring. Consequently there is a order for the keyring location:

  1. Use local keyring in workspace, when detected
  2. When not 1. , then check for GnuPG.homedir configuration
  3. When not 2. , then use GnuPG default keyring location

Using several VSCode instances at the same time is not recommended, because the gpg-agent is running in the background for one session. Otherwise you have to kill the session. TIP: Change folder in one instance, because gpg-agent will be killed automatically.

Use Check GnuPG command to see the current used home directory.

Support for GnuPG v1.4

With GnuPG v1.4, there is no pinentry window, where you can enter a pin. Therefore, all commands, which require a pin input, will be prepared to run in the internal terminal. The commands are written to the terminal and you have to press RETURN and follow the instructions. Some functions are not available at all. GnuPG does not work perfectly in the VSCode terminal, or in other terminal emulators (hyper, cmder, ...). Therefore all commands for the terminal are additionally copied to the clipboard so that you can insert them in a real terminal window (cmd, bash, ...).

Requirements

GnuPG

Windows

  • Use pure GnuPG installation (gnupg-w32-<version>_<date>.exe)
  • or Gpg4win

OSX

  • GPG Suite

Debian

  • Refer to GnuPG binary releases

Raspbian

  • additional QT based PIN or pass-phrase entry dialog for GnuPG, or equivalent, is required
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft