Description
I've experienced that the following code works just fine:
var x509Chain = new X509Chain();
x509Chain.Build(someCert);
var certs = x509Chain.ChainElements.Select(ce => ce.Certificate).ToList();
x509Chain.Dispose();
// make use of certs, even calling methods like GetRSAPublicKey() does not throw
It looks like the X509Certificate2 objects inside a chain are not disposed with the chain. Is that so? Do I need to dispose them myself when I dispose the chain to do proper cleanup?
Best regards,
D.R.