Commit 653ca83
committed
Fixed ECDH key to have keyAgreement in its KeyUsage extension
It seems that the latest X509Certificate2 impl validates that this key usage is set if the KeyUsage extension exists.
Unfortunately, this still isn't enough to fix CmsSignerTests.TestConstructors() which is now failing with:
System.Security.Cryptography.CryptographicException: Keyset does not exist
at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider, CngKeyOpenOptions openOptions)
at System.Security.Cryptography.X509Certificates.CertificatePal.GetPrivateKey[T](Func`2 createCsp, Func`2 createCng)
at System.Security.Cryptography.X509Certificates.CertificateExtensionsCommon.GetPrivateKey[T](X509Certificate2 certificate, Predicate`1 matchesConstraints)
at MimeKit.Cryptography.X509Certificate2Extensions.GetPrivateKeyAsAsymmetricKeyParameter(X509Certificate2 certificate) in C:\src\MimeKit\MimeKit\Cryptography\X509Certificate2Extensions.cs:line 249
at MimeKit.Cryptography.CmsSigner..ctor(X509Certificate2 certificate, SubjectIdentifierType signerIdentifierType) in C:\src\MimeKit\MimeKit\Cryptography\CmsSigner.cs:line 347
at UnitTests.Cryptography.CmsSignerTests.TestConstructors() in C:\src\MimeKit\UnitTests\Cryptography\CmsSignerTests.cs:line 1551 parent c7b0f35 commit 653ca83
4 files changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Binary file not shown.
0 commit comments