Commit graph

11 commits

Author SHA1 Message Date
Nick
fed8875957
Add Multi-OS/Path support 2026-06-15 16:29:32 +01: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
1a4c73fc76
Add extra info in decrypt 2024-01-23 12:28:10 -05:00
Luis Alberto Jaramillo Gonzalez
8292082fec
Decrypt modal is working now 2024-01-23 10:31:05 -05:00
Luis Alberto Jaramillo Gonzalez
184fa9f8ad
Create decrypt method 2024-01-22 21:31:28 -05:00
Luis Alberto Jaramillo Gonzalez
08dfc04a23
Create decrypt preview modal 2024-01-22 21:12:18 -05:00
Luis Alberto Jaramillo Gonzalez
67e2d652f2
Live Preview is done 2024-01-22 10:34:10 -05:00
Luis Alberto Jaramillo Gonzalez
6382c40430
Refactorize some code and add links from hotkeys to encrypt modal 2024-01-20 15:43:40 -05:00
Luis Alberto Jaramillo Gonzalez
2c29ab23d5
New settigs item with list of GPG public keys 2024-01-20 13:57:10 -05:00
Luis Alberto Jaramillo Gonzalez
1f4d65d6fa
GPG Executable Path setting is added in settings tab 2024-01-20 12:47:56 -05:00
Luis Alberto Jaramillo Gonzalez
efa073e360
Initial commit with default obsidian plugin template 2024-01-04 13:45:32 -05:00