I have two certificates that I saved to disk. One of them is a private key certificate that I exported as a .pfx file, the other is a certificate that I saved, including its certificate chain as a PKCS # 7 file ("certchain.p7b").
In C #, I can upload a .pfx file using
var cert = new X509Certificate2(myPfxFileStream);
(myPfxFileStream is FileStreamopen for reading by the .pfx file), but try to do the same with the PKCs # 7 certificate in CryptoGraphicException"Der Indexwert ist ungültig", which translates to "invalid index value".
I assume that I should deal with PKCS # 7 (it contains a chain, not one certificate!), But how?
(Oh, by the way: I currently do not have passwords on these certficiates)
source
share