Add Private Key Agent support for signing and decryption - #97
Open
tvdijen wants to merge 1 commit into
Open
Conversation
Prior to this change, RSA signing and RSA key-transport decryption could only be done with a private key loaded into the PHP process. For better security we need those two operations to be delegated to a remote Private Key Agent, so the private key never enters the application's memory, while public operations (verify, encrypt) keep running locally. This change adds the extension points needed to route the private-key operations to the agent without breaking existing consumers. Insecure algorithms (SHA-1, RSA v1.5) stay blacklisted by default. As a hardening side effect, the key-transport read path now enforces the OAEP DigestMethod and MGF that were previously ignored.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #97 +/- ##
============================================
+ Coverage 92.97% 93.31% +0.33%
- Complexity 763 905 +142
============================================
Files 125 133 +8
Lines 2905 3275 +370
============================================
+ Hits 2701 3056 +355
- Misses 204 219 +15 🚀 New features to boost your workflow:
|
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.
Prior to this change, RSA signing and RSA key-transport decryption could only be done with a private key loaded into the PHP process. For better security we need those two operations to be delegated to a remote Private Key Agent, so the private key never enters the application's memory, while public operations (verify, encrypt) keep running locally.
This change adds the extension points needed to route the private-key operations to the agent without breaking existing consumers. Insecure algorithms (SHA-1, RSA v1.5) stay blacklisted by default. As a hardening side effect, the key-transport read path now enforces the OAEP DigestMethod and MGF that were previously ignored.