Skip to content

Fix rich consent signing with Android Keystore keys - #150

Draft
lucas-heidihealth wants to merge 1 commit into
auth0:masterfrom
lucas-heidihealth:fix/android-keystore-rich-consent-signing
Draft

Fix rich consent signing with Android Keystore keys#150
lucas-heidihealth wants to merge 1 commit into
auth0:masterfrom
lucas-heidihealth:fix/android-keystore-rich-consent-signing

Conversation

@lucas-heidihealth

Copy link
Copy Markdown

Summary

  • Fix rich-consent DPoP signing for Android Keystore-backed RSA keys.
  • Use JCA Signature with the existing PrivateKey abstraction instead of casting to RSAPrivateKey.

Root cause

RichConsentsAPIClient casts the enrollment PrivateKey to RSAPrivateKey before signing. Android Keystore provides AndroidKeyStoreRSAPrivateKey, which can sign through Signature but does not implement java.security.interfaces.RSAPrivateKey. This causes Guardian.fetchConsent to crash before the request is sent.

This is the same failure reported in #149.

Verification

ANDROID_HOME=/Users/lucas/Library/Android/sdk ./gradlew :guardian:testDebugUnitTest
BUILD SUCCESSFUL

The existing rich-consent client tests pass, and the signing implementation now follows the same SHA256withRSA/PrivateKey approach already used by the SDK's allow/reject request path.

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.

1 participant