I have a X509Certificate2Collection, and I want to tell whether a given certificate is either in it or signed by a CA in the collection.
I do NOT want to reference the Windows certificate stores, which seems to be what every example shows. This is for a secure application, and I do not care that CheapCertificate.Com has trusted some cert, only that specific CAs that I explicitly specify are valid.
Also, is it possible to use SslStream against anything other than the global store? I could not see any parameter that set it.
To be clear, the wrong way is
foreach (X509Certificate2 trustedIssuer in trustedCerts) {
if (trustedIssuer.Subject == certificate.Issuer) {...