Add support for deciphering encrypted LCP user fields - #871
Draft
mickael-menu wants to merge 1 commit into
Draft
mickael-menu wants to merge 1 commit into
mickael-menu wants to merge 1 commit into
Conversation
Fixes #147. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stevenzeck
reviewed
Aug 10, 2026
| func decryptedString(from value: String?) throws -> String? { | ||
| guard | ||
| let value = value, | ||
| let encryptedData = Data(base64Encoded: value), |
Contributor
There was a problem hiding this comment.
I would add ignoreUnknownCharacters in case there are weird spaces in the json payload.
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.
Fixes #147.
Exposes liblcp's
decryptField()(available since R2LCPClient 4.3.0) through the toolkit:decryptField(field:using:)on theLCPClientfacade, forwarding raw (Base64-decoded) ciphertext toR2LCPClient.decryptField. For consistency on the breaking 4.0 release,getSupportedLCPProfileURIs()also becomes a hard requirement and both backward-compatible defaults are removed.decipherUserField(_:)requirement and a best-effortdecipheredUser()convenience onLCPLicense: it returns theUserwith the fields listed inencrypted(e.g.name,email) decrypted with the user key. Fields that cannot be deciphered are left untouched and remain listed inencrypted; the call throws when the license is restricted.Includes TestApp facade forwarding, 9 unit tests for the field decryption, and CHANGELOG, Migration Guide and LCP guide updates.
Note: the
decryptFieldinput format (raw ciphertext, no internal Base64 decode) was verified against the disassembled 4.3.0 framework; a quick runtime check with a real license containing encrypted user fields would be a definitive confirmation.🤖 Generated with Claude Code