How to set Keys of X509Certificate2 to a custom implementation #68127
Unanswered
Danielku15
asked this question in
Q&A
Replies: 1 comment
-
Slightly, but they didn't go very far: #22856.
Not at this time, no. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is by today with .net 6 the recommended way of setting a custom Public/Private Key implementation in a X509Certificate2 instance?
The problem is that most of the libraries and integrations in the market rely on
.PrivateKey
or.GetRSAPrivateKey()
access on the certificate itself and often do not offer a way of passing on the private key separately.Due to all the workarounds in the X509Certificate2 API (not having a raw PrivateKey property but relying on the extension methods) it got impossible now to supply a custom PublicKey and PrivateKey instances to a custom implementation. X509Certificate2 is the quasi-standard interface used for most libraries.
I want to provide custom implementations for the Public/PrivateKey to leverage cloud services like Azure KeyVault for signing.
For now I'm planning to generate in-memory a custom
ICertificatePalCore
implementation and set it through reflection tricky. This is of course very hacky and prone to errors.Were there maybe in the past already discussions in this regards? Are there plans to support a
.Set###PrivateKey()
extension to support usecases where the cryptographic operations are not handled by the platform specific implementation?References
Beta Was this translation helpful? Give feedback.
All reactions