The following method gets one exception when loading a pxf from a byte array , it wont throw any error to the app but i cant use the certificate to authenticate. if i use the old method (X509Certificate2) the pfx loads without issues.
the private key throws the message "Keyset does not exist"
PrivateKey 'cert.PrivateKey' threw an exception of type 'System.Security.Cryptography.CryptographicException' System.Security.Cryptography.AsymmetricAlgorithm {System.Security.Cryptography.CryptographicException}
Data Count = 0 System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
Raw View
HResult -2146893802 int
HelpLink null string
InnerException null System.Exception
Static members
Message "Keyset does not exist" string
Source "System.Security.Cryptography" string
StackTrace " at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider, CngKeyOpenOptions openOptions)\r\n at System.Security.Cryptography.X509Certificates.CertificatePal.GetPrivateKey[T](Func2 createCsp, Func2 createCng)\r\n at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()" string
Description
The following method gets one exception when loading a pxf from a byte array , it wont throw any error to the app but i cant use the certificate to authenticate. if i use the old method (X509Certificate2) the pfx loads without issues.
the private key throws the message "Keyset does not exist"
Reproduction Steps
string pfxPass = "TESTEwebservice"
string pfxFileb64String = "MIIilgIBAzCCIkIGCSqGSIb3DQEHAaCCIjMEgiIvMIIiKzCCCtEGCSqGSIb3DQEHAaCCCsIEggq+MIIKujCCCrYGCyqGSIb3DQEMCgECoIIJwTCCCb0wVwYJKoZIhvcNAQUNMEowKQYJKoZIhvcNAQUMMBwECJvtKm8ndjLTAgIH0DAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQUUvG3m1+8G5uVXN/KGNdoASCCWDcRFwIBvSa76TgfWw9Kj71FQGQG6a7fnV62OKiUemjyoiC/dWozGYG3AiTxmUnQ+Ey+XHcigceu9ONr25I0R67UTd7QeAt2QVlav5fRZXj98hybrOjAt1lAt4Itm2EOcsVPIUrlpERhZJhMiJxFJI/DcMsomIgHeSI6uOb8w6hrG6wumL7VRdgnjf77xTBuAUD0Rve4vVew4w6Kx5MUwENavB1i/U8o34faLYmlC9gGlhLt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qC1iPGqowrG151TUnB/d2utgL6qtzw5EqH4jltOkf0MmW7MyNHSb6CGHPg1ORyTaDCWjf85bZU6hbKRtvL98p63ZetLzQQDTkDdeOnX+JEpOvbkZJKEbwinXCT75ol+UvTDzo9Gfy80qXAARMb/tW5bL5FJ2UW1Df8W71RYWLFZzoQbPk+pqJBdIPAEHDfNOF7IOQBL8MlpocxQNySaB1UMBohmDPydmMLsGH89P+0qTYqmiueAiPEpKBYXH0DW4qFIdkuSKnZIDsbZsBVLUn1F0NmAggp+ZU1b8ZVcT6X1bsgq+9RVAFjKbIWRl5flUTBufyrk4qmZKQqkRPpbsx7wSiRIVWypCWfKugTeS2rzUeeqQBpwcAlwDYcdbwIk7MFMEuHTHlaQF+TP79TRBaeGwID09x0wB6EuvR2zhGr5IQaHERRvXvJTsEVg3yVMEswLzALBglghkgBZQMEAgEEIGoZZnRfwJN2izUK70ZzARTxTxykAvdfBo76msxpff44BBT99N1gSrx9cIS89KjVTOf0BkIzVAICB9A="
pfxFile = Convert.FromBase64String(pfxFileb64String);
var cert = X509CertificateLoader.LoadPkcs12(_pfxFile!, _pfxPass, X509KeyStorageFlags.MachineKeySet);
Expected behavior
The certificate loads with all the information on it including the private key:
=====================================================================
KeyExchangeAlgorithm "RSA" string KeySize 4096 int KeySizeValue 4096 int
=====================================================================
Actual behavior
If you inspect the cert var the private key have the following error
===================================================
HResult -2146893802 int HelpLink null string
Message "Keyset does not exist" string Source "System.Security.Cryptography" string StackTrace " at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider, CngKeyOpenOptions openOptions)\r\n at System.Security.Cryptography.X509Certificates.CertificatePal.GetPrivateKey[T](Func
2 createCsp, Func
2 createCng)\r\n at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()" string=====================================================================
Regression?
IF i use the old methods, obsolete in .net 9, using the data provided above it works without issues:
string pfxPass = "TESTEwebservice"
string pfxFileb64String = "MIIilgIBAzCCIkIGCSqGSIb3DQEHAaCCIjMEgiIvM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zH6Yz48ME9d75ICtk90YyInhcYR/kTHoyxUKULxclPkayyhYhFLhZ9Coi9Hk4Zd8QDcwlnry+NTMx1FSAe5u8up7NUjt2Vh+WrS4BHr1ive3rEdUVBwJjXqSwXcCgAX56iZjtBKd8jitRW+fvSbb6NhJuoMqQ1uBkKugxGXXcDYUfXjeQjZQPoZg/wguqgQp8fIiLDis+BgsxD+sDo/4L4xed6paKX5kQLZJhmW+CLtgWzn+nZicly+SwOV0is5NzSAQStb5TgI/G1O8WTym7RE5bbNgB/4/Gf7ZQdbX+MiiZxwSles7hB6ul8lKPOlULdvTEAwe3VuicvVooRDZlPfdn2wbzwPwVCuvVIXIINq1H6N7VrAAVkzSjGK9yCsNJ90ZiNZKkvjUXz5ITr01if41/U90M32h1/9aQToRi+LfdYD9aWion7nqC1iPGqowrG151TUnB/d2utgL6qtzw5EqH4jltOkf0MmW7MyNHSb6CGHPg1ORyTaDCWjf85bZU6hbKRtvL98p63ZetLzQQDTkDdeOnX+JEpOvbkZJKEbwinXCT75ol+UvTDzo9Gfy80qXAARMb/tW5bL5FJ2UW1Df8W71RYWLFZzoQbPk+pqJBdIPAEHDfNOF7IOQBL8MlpocxQNySaB1UMBohmDPydmMLsGH89P+0qTYqmiueAiPEpKBYXH0DW4qFIdkuSKnZIDsbZsBVLUn1F0NmAggp+ZU1b8ZVcT6X1bsgq+9RVAFjKbIWRl5flUTBufyrk4qmZKQqkRPpbsx7wSiRIVWypCWfKugTeS2rzUeeqQBpwcAlwDYcdbwIk7MFMEuHTHlaQF+TP79TRBaeGwID09x0wB6EuvR2zhGr5IQaHERRvXvJTsEVg3yVMEswLzALBglghkgBZQMEAgEEIGoZZnRfwJN2izUK70ZzARTxTxykAvdfBo76msxpff44BBT99N1gSrx9cIS89KjVTOf0BkIzVAICB9A="
pfxFile = Convert.FromBase64String(pfxFileb64String);
var cert = new X509Certificate2(_pfxFile!, _pfxPass, X509KeyStorageFlags.MachineKeySet);
Known Workarounds
Use the old method X509Certificate2, even it states that the method is obsolete
Configuration
.Net 9 Windows 11 Enterprise x64 Using Blazor Server, tested on Chrome
Other information
No response