Skip to content

feat(pgp): support delegated OpenPGP providers - #175

Open
pando85 wants to merge 35 commits into
mainfrom
feature/openpgp-provider
Open

pando85 wants to merge 35 commits into
mainfrom
feature/openpgp-provider

Conversation

@pando85

@pando85 pando85 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an optional provider-agnostic OpenPGP API backend alongside APS' internal key manager
  • delegate private-key decryption to the selected provider for password, autofill, and passkey flows
  • retrieve and validate public certificates as needed while keeping encryption local with PGPainless
  • preserve hierarchical .gpg-id recipient policy, including multi-recipient passkey creation
  • handle OpenPGP permission/user-interaction continuations through the Activity Result API

Security and behavior

  • APS never retrieves or imports provider secret-key material
  • fetched certificates are rejected if they contain secret key material and are checked against the requested key ID before local import
  • foreground provider interaction is coroutine-scoped so background passkey/index work cannot consume another activity's interaction
  • discarded provider output and passkey ciphertext/plaintext error paths are zeroized
  • provider bind/interaction failures fail closed instead of silently falling back to a local private key
  • the internal PGP backend remains the default and can still be selected explicitly

This deliberately implements the OpenPGP API as a delegated cryptographic backend rather than a remote KeyManager: ACTION_GET_KEY is used for public certificates only, while private-key operations remain inside the provider. Provider-side encryption/signing is not required for pass-compatible APS operation, so encryption remains local using the resolved public certificates.

Validation

The branch has been exercised with:

  • spotlessCheck
  • :app:testDebugUnitTest
  • :passkeys:core:test
  • :passkeys:provider:testDebugUnitTest
  • :crypto:pgpainless:test

The repository's normal PR workflow additionally runs the complete slim unit-test suite, APK assembly, lint, codestyle, and the passkey compatibility suite.

Closes #152

pando85 and others added 28 commits September 21, 2026 13:34
@forkline-bot

forkline-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

The lint error (AvoidUsingNotNullOperator at OpenPgpProviderRepository.kt:151) was already fixed in commit 9963d00 — replaced importFailure!! with a safe ?.let pattern. No !! operators remain in the source. CI should pass on the current HEAD.

@forkline-bot

forkline-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

Fix pushed:

Fixed two lint issues:

  1. Replaced runCatching with a specific try/catch(Exception) at OpenPgpApiBackend.kt:277 to satisfy the DenyListedApi lint rule
  2. Removed 4 stale InvalidPackage entries from lint-baseline.xml that were no longer matching (LintBaselineFixed)

@forkline-bot

forkline-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

⏸️ CI Auto-Fix paused

A user commit was detected after an automated fix. CI auto-fix is now paused
to prevent conflicts with your changes.

To resume CI auto-fix, use the /reset or /reset-ci-auto-fix command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Support importing/retrieving keys via the OpenPGP API (as offered by some keyring apps)

1 participant