using System; using System.Security.Cryptography.X509Certificates; using ln.collections; namespace ln.http; public class CertificateStore { private Cache _cache = new Cache(); public CertificateStore() { } public virtual void AddCertificate(X509Certificate certificate) => _cache.Add(certificate.Subject, certificate); public virtual bool TryGetCertificate(string hostname, out X509Certificate certificate) => _cache.TryGetValue(String.Format("CN={0}", hostname), out certificate); public virtual void RemoveCertificate(string hostname) => _cache.Remove(hostname); }