-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Centralize key validations and check more invalid cases #156
Conversation
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Codecov Report
@@ Coverage Diff @@
## main #156 +/- ##
==========================================
+ Coverage 91.05% 91.52% +0.47%
==========================================
Files 12 12
Lines 1542 1545 +3
==========================================
+ Hits 1404 1414 +10
+ Misses 101 94 -7
Partials 37 37
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
@thomas-fossati @yogeshbdeshpande @shizhMSFT please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thanks!
This PR does the following:
Key.Validate
private. The checks in that method are not exhaustive, e.g., we not validating that the key cryptographically ok. I would rather keep it private so we can evolve it without being tied to an specific behavior.Key.PublicKey
andKey.PrivateKey
now callKey.validate
so we don't return a malformed key.NewSymmetricKey
no longer returns an error, as this function can't fail.