Commit graph

6 commits

Author SHA1 Message Date
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
7abafe9e23
Add credits in readme 2024-04-01 10:32:53 -05:00
Luis Alberto Jaramillo Gonzalez
8f93b8884e
Some extra info to decrypt in readme 2024-01-23 17:39:09 -05:00
Luis Alberto Jaramillo Gonzalez
dbfbd5953e
Some readme instructions 2024-01-23 17:27:27 -05:00
Luis Alberto Jaramillo Gonzalez
6a9fec4e8b
readme.md 2024-01-23 12:35:34 -05:00
Luis Alberto Jaramillo Gonzalez
efa073e360
Initial commit with default obsidian plugin template 2024-01-04 13:45:32 -05:00