[PM-32438] Implement cose encoding for RSA keys#769
Draft
Conversation
Contributor
|
Great job! No new security vulnerabilities introduced in this pull request |
Contributor
🔍 SDK Breaking Change Detection ResultsSDK Version:
Breaking change detection completed. View SDK workflow |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #769 +/- ##
==========================================
+ Coverage 81.25% 81.32% +0.07%
==========================================
Files 316 316
Lines 36369 36550 +181
==========================================
+ Hits 29553 29726 +173
- Misses 6816 6824 +8 ☔ View full report in Codecov by Sentry. 🚀 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.





🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32438
📔 Objective
Implements support for encoding RSA keys as COSE. We already support encoding symmetric, AEAD, keys as COSE, and signing / verifying keys as COSE. This PR adds support for private keys.
The intention is that the "Key-protected-key-envelope" safe primitive only allows COSE encodings of private, signing keys.
Note: Key-id's are usually randomly generated in COSE. However, we still allow DER/PEM encodings, at least for RSA. While these will be deprecated for encryption, we still interoperate with them so there has to be a way to represent RSA keys. Instead of giving these no key-id, instead we derive a key-id deterministically from the public-key-components of the RSA key. That gives us the benefit of the key-id, and it's application stability use-cases / traceability use-cases without any interoperability issues.
🚨 Breaking Changes