We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I got stuck on this problem until I checked the source code. Maby add another error message to this?
On this line
MimeKit/MimeKit/Cryptography/CmsSigner.cs
Line 192 in 2249574
The code checkes if it has found a private key, if not it returns "The stream does not contain a private key".
But on this line, it skips all certificates that doesnt have the correct key usage.
Line 177 in 2249574
So if you use a self signed certificate, that contains a private key, but has the wrong usage, you get the wrong error message :(
To reproduce, create a key like this and try and sign with it:
New-SelfSignedCertificate -Type Custom -Subject "CN=TestCertificate" -KeyUsage DataEncipherment -KeyAlgorithm RSA -KeyLength 2048 -SmimeCapabilities -CertStoreLocation "Cert:\CurrentUser\My"
The text was updated successfully, but these errors were encountered:
I’ll look into it.
Sorry, something went wrong.
Provide a better error message when the cert within a pkcs12 cannot d…
f01333f
…igital sign Fixes issue #367
No branches or pull requests
I got stuck on this problem until I checked the source code.
Maby add another error message to this?
On this line
MimeKit/MimeKit/Cryptography/CmsSigner.cs
Line 192 in 2249574
The code checkes if it has found a private key, if not it returns "The stream does not contain a private key".
But on this line, it skips all certificates that doesnt have the correct key usage.
MimeKit/MimeKit/Cryptography/CmsSigner.cs
Line 177 in 2249574
So if you use a self signed certificate, that contains a private key, but has the wrong usage, you get the wrong error message :(
To reproduce, create a key like this and try and sign with it:
New-SelfSignedCertificate -Type Custom -Subject "CN=TestCertificate" -KeyUsage DataEncipherment -KeyAlgorithm RSA -KeyLength 2048 -SmimeCapabilities -CertStoreLocation "Cert:\CurrentUser\My"
The text was updated successfully, but these errors were encountered: