Skip to content

feat(pqa): advanced signatures - #479

Open
smanikw wants to merge 5 commits into
pqa/password-changefrom
pqa/advanced-signatures
Open

feat(pqa): advanced signatures#479
smanikw wants to merge 5 commits into
pqa/password-changefrom
pqa/advanced-signatures

Conversation

@smanikw

@smanikw smanikw commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

closes #461 #295

@smanikw
smanikw requested a review from a team as a code owner September 2, 2026 19:03
@smanikw
smanikw requested review from kober32 and removed request for a team and kober32 September 2, 2026 19:03
@smanikw smanikw linked an issue Sep 2, 2026 that may be closed by this pull request
@smanikw smanikw changed the title feat(pqa): add advanced signatures feat(pqa): advanced signatures Sep 2, 2026
@smanikw
smanikw force-pushed the pqa/advanced-signatures branch from 1d4ae09 to 3e1d579 Compare September 3, 2026 08:29
@smanikw smanikw linked an issue Sep 3, 2026 that may be closed by this pull request
@smanikw
smanikw force-pushed the pqa/advanced-signatures branch 2 times, most recently from d0c47b1 to bde5ddf Compare September 7, 2026 12:11
Use the existing two-argument constructAuthentication helper on iOS for
advanced signing APIs, and add Flutter-parity coverage for tampered data
and authentication-purpose rejection on the new signature methods.
Match existing iOS callback comments so the deliberate (void)auth retention
is not mistaken for dead code and removed.
Use the function form of expect().toSucceed() so successful verify*
calls are actually awaited and failures fail the test.
Copilot AI lite review requested due to automatic review settings September 8, 2026 13:25
@smanikw
smanikw force-pushed the pqa/advanced-signatures branch from bde5ddf to 61eb16b Compare September 8, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new CSR E2E test parses PEM using split('\n') and can fail if native output uses CRLF line endings, making the test brittle across platforms.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds “advanced signatures” support across the shared JS API and both native bridges (Android + iOS), including explicit signature key identifiers, digital signatures, JWS/JWT signing & verification, device public-key export, and CSR generation, with accompanying E2E coverage and documentation updates (closes #461, #295).

Changes:

  • Added new public API methods on PowerAuth for digital signatures, JWS/JWT signatures, CSR creation, and device public-key export, plus new key-id/type models.
  • Implemented the corresponding native bridge methods in iOS and Android (React Native + Cordova).
  • Extended the testapp E2E suite with protocol-4 configuration support and new advanced-signature tests; updated docs/changelog accordingly.
File summaries
File Description
testapp/src/IntegrationUtils.ts Allows E2E helper to select PowerAuth algorithm (legacy default; protocol-4 suites can opt in).
testapp/_tests/PowerAuth_Signature.test.ts Extends authentication-purpose negative coverage to new advanced-signature APIs.
testapp/_tests/PowerAuth_AdvancedSignature.test.ts New E2E suite for device public keys, ML-DSA signatures, JWS, and CSR.
testapp/_tests/AllTests.ts Registers the new advanced-signature test suite.
packages/lib-shared/js/PowerAuth.ts Adds the new public JS API surface and deprecates legacy helpers in favor of explicit key ids.
packages/lib-shared/js/model/PowerAuthSignatureKeyId.ts Introduces key-id and key-type enums for selecting signing/verification keys.
packages/lib-shared/js/model/PowerAuthDevicePublicKey.ts Adds public model types for exported device public keys.
packages/lib-shared/js/index.ts Exposes the new model types via the package public exports.
packages/lib-shared/ios/PowerAuth/PowerAuthModule.m Implements iOS bridge for digital signature/JWS/CSR/public-key export and key-id parsing.
packages/lib-shared/android/.../PowerAuthJsModule.kt Implements Android bridge for the same features, including key-id parsing and CSR SAN handling.
packages/lib-rn/android/.../PowerAuthModule.java Exposes new Android bridge methods to React Native.
packages/lib-cordova/android/.../PowerAuthModule.kt Adds Cordova action dispatch + argument wiring for new features.
packages/lib-cordova/android/.../bridge/Mappings.kt Adds optional ReadableArray mapping needed for CSR SAN argument.
docs/Data-Signing.md Updates user docs to the new APIs and clarifies Base64 handling and deprecations.
docs/Changelog.md Records the new advanced-signature feature set in the changelog.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +145 to +147
const lines = csr.trim().split('\n')
expect(lines[0]).toBe('-----BEGIN CERTIFICATE REQUEST-----')
expect(lines[lines.length - 1]).toBe('-----END CERTIFICATE REQUEST-----')
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.

PQA: advanced signatures Implement "create CSR" feature

2 participants