Commit graph

18 commits

Author SHA1 Message Date
Luis Alberto Jaramillo Gonzalez
0fef6f6ee7
fix: resolve three settings bugs and add passphrase prompt for signing (v1.2.0)
- Sign key dropdown was empty when switching from openpgpjs to CLI because
  RefreshLibrary never repopulated it with native GPG keys; now calls
  RefreshListSign on library switch and resets the "sign" sentinel to "0".

- Library dropdown did not persist the selection on change, causing pgpLibrary
  to revert to "openpgpjs" on reload and triggering the PassphraseModal
  unexpectedly during CLI decryption; fixed by calling saveSettings() in
  the dropdown onChange handler.

- Sign key dropdown appeared twice when RefreshListSign was called concurrently
  (e.g. from display() and RefreshLibrary); fixed with a generation counter
  that discards stale async results before addDropdown() is called.

- Encrypt with openpgpjs + signing enabled threw "signing key is not decrypted"
  when the passphrase field was left blank; EncryptText() now resolves the
  passphrase from cache/settings or prompts via PassphraseModal before calling
  gpgEncrypt(), and caches it after a successful sign+encrypt.
2026-05-27 14:22:19 -05:00
scott
99b77ff3c2 [Implement the openpgpjs encryption backend that 1.1.5 already scaffolds
in settings. Selecting the "openpgpjs" GPG Library now performs all
crypto in-app via OpenPGP.js instead of the native gpg binary, so the
plugin works on mobile (Android/iOS) as well as desktop. The native
"CLI commands" path is unchanged and remains the choice for OS keychain
and YubiKey users.]

feat: implement OpenPGP.js backend for mobile support

The pgpLibrary setting and its "openpgpjs" option already existed in
1.1.5, but choosing it hid the native UI without providing an
implementation. This adds that implementation as an opt-in second
backend, leaving the native gpg path fully intact.

Changes:
- src/openpgp.ts: OpenPGP.js getListPublicKey/gpgEncrypt/gpgDecrypt,
  an in-memory passphrase cache, and browser-safe base64 helpers.
- src/PassphraseModal.ts: prompts for the private-key passphrase
  (mobile has no pinentry/gpg-agent).
- src/gpg.ts: the three crypto functions dispatch on settings.pgpLibrary;
  child_process is now required lazily so the module loads on mobile.
- src/Settings.ts: adds pgpPublicKeyArmored, pgpPrivateKeyArmored,
  pgpPassphrase, pgpPassphraseCacheMinutes; guards process.platform.
- src/SettingsTab.ts: renders armored-key/passphrase/cache UI in the
  openpgpjs branch (instead of only hiding native settings); fs is now
  required lazily; hides the native sign toggle in openpgpjs mode.
- src/EncryptModal.ts / src/DecryptPreviewModal.ts: openpgpjs branches
  (single configured key, passphrase prompt + cache, browser-safe base64).
- manifest.json: isDesktopOnly false. styles.css: .gpg-key-textarea.
- README.md: documents the openpgpjs library option.

The base64 wire format is identical between backends, so blocks encrypted
with native gpg and with OpenPGP.js are interchangeable for the same key.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:17:31 +10:00
Luis Alberto Jaramillo Gonzalez
c202ed7f32
Update version to 1.1.5 2025-12-03 12:02:35 -05:00
Luis Alberto Jaramillo Gonzalez
13062783f1
New setting tab to show whole GPG command in Obsidian Developer Console 2024-08-25 19:59:04 -05:00
Luis Alberto Jaramillo Gonzalez
99fc63f12f
Creating a new 1.1.3 version 2024-08-25 19:15:29 -05:00
Luis Alberto Jaramillo Gonzalez
a5ed3de902
Fix the version number 2024-08-14 12:29:15 -05:00
Luis Alberto Jaramillo Gonzalez
c90889c15a
Fix issue installing plugin 2024-08-14 12:25:31 -05:00
Luis Alberto Jaramillo Gonzalez
2c6d745144
Add new feacture to include add a before and after gpg command 2024-08-14 12:09:26 -05:00
Luis Alberto Jaramillo Gonzalez
fc42009b73
Add new version 1.0.7 2024-04-02 07:43:51 -05:00
Luis Alberto Jaramillo Gonzalez
e199e22dc3
Upgrade to 1.0.6 version 2024-03-08 15:17:32 -05:00
Luis Alberto Jaramillo Gonzalez
6202d643f1
Upgrade version to 1.0.5 2024-03-03 13:01:48 -05:00
Luis Alberto Jaramillo Gonzalez
264a40a95f
Fix all versions in *.json files 2024-02-19 09:52:15 -05:00
Luis Alberto Jaramillo Gonzalez
af8b0dd9ae
Fix author information 2024-02-08 09:24:17 -05:00
Luis Alberto Jaramillo Gonzalez
afe8979f7a
Lauch new version 1.0.1 with bug fixes 2024-01-24 12:02:41 -05:00
Luis Alberto Jaramillo Gonzalez
2fe6a0ca58
Manifest author adjust 2024-01-20 14:31:04 -05:00
Luis Alberto Jaramillo Gonzalez
537c8c65e5
Turn on flag Desktop Only 2024-01-20 14:03:28 -05:00
Luis Alberto Jaramillo Gonzalez
f1671135d0
Adjust manifest.json with last website info 2024-01-19 16:02:37 -05:00
Luis Alberto Jaramillo Gonzalez
efa073e360
Initial commit with default obsidian plugin template 2024-01-04 13:45:32 -05:00