Repository navigation
fix(sdk,cmdline): DSPX-1561 pass the default assertion verification key to the SDK - #435
Open
dmihalcik-virtru wants to merge 1 commit into
Open
dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
…ey to the SDK The decrypt command's assertion verification keys file now converts defaultKey (or DefaultKey) the same way as per-ID keys: an HS256 key is the UTF-8 bytes of its string and an RS256 key is a PEM public key. The SDK already verifies an assertion with no per-ID key with the default key, but the CLI passed it on as unconverted text. A keys file that cannot be used as written is reported with reason=configuration-error rather than leaving a key out: an unknown top-level member, an alg other than RS256 or HS256, a key with members but no alg, a key that cannot be read, or PEM text as an HS256 secret. A per-ID entry that is null or empty stays an entry, so verifying that assertion fails instead of falling back to another key. Document, in the SDK javadoc and the decrypt command's help, that a default key applies to every assertion without a per-ID key, including payload-key assertions such as the system-metadata assertion the Java writer adds, so those fail verification; point to per-ID keys instead. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 9, 2026
fix(otdfctl): DSPX-1561 pass the default assertion verification key to the SDK
opentdf/platform#4304
Open
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Proposed Changes
--with-assertion-verification-keysJSON now convertsdefaultKey(orDefaultKey) like the per-ID keys: an HS256 key is the UTF-8 bytes of its string, an RS256 key a PEM public key. The SDK already falls back to the default key for assertions without a per-ID key, but the CLI passed the key on as unconverted text.reason=configuration-errorinstead of silently dropping a key: an unknown top-level member (such asdefault_key), analgother than RS256 or HS256, a key with members but noalg, an unreadable key, or PEM text given as an HS256 secret. Anullor empty per-ID entry stays an entry, so that assertion fails rather than falling back to another key.Config.AssertionVerificationKeysand the decrypt help explain that a default key applies to every assertion without a per-ID key, including payload-key assertions such as thesystem-metadataassertion this SDK writes, so those fail; use per-ID keys for files that carry both.Split out of #432 (draft; the complete change). Cross-SDK counterparts: opentdf/platform#4304, opentdf/web-sdk#1138.
Compatibility: keys files with unknown top-level members, unsupported algorithms, or PEM text as an HS256 secret are now rejected.
Checklist
Testing Instructions
mvn -pl sdk,cmdline -am test(new cases incmdline/.../AssertionVerificationKeysTest).