static void InstallCerts(IX509CertificateStore store, IEnumerable <X509Certificate2> certs) { foreach (X509Certificate2 cert in certs) { if (!store.Contains(cert)) { store.Add(cert); } } }
/// <summary> /// Creates an instance of an index initialized from an <see cref="IX509CertificateStore"/> /// </summary> /// <param name="store">The <see cref="IX509CertificateStore"/> instance to intialize the index from</param> public CertificateIndex(IX509CertificateStore store) { if (store == null) { throw new ArgumentNullException("store"); } m_store = store; this.Refresh(); }
void InstallCerts(IX509CertificateStore store, IEnumerable <X509Certificate2> certs) { foreach (X509Certificate2 cert in certs) { if (!store.Contains(cert)) { WriteLine("Installing {0} HasPrivateKey={1}", cert.ExtractEmailNameOrName(), cert.HasPrivateKey); store.Add(cert); } } }
/// <summary> /// Initializes an instance with separate certificate stores for incoming and outgoing messages. /// </summary> /// <param name="outgoingAnchors">Trust anchor store used to validate messages for sending</param> /// <param name="incomingAnchors">Trust anchor store used to validate messages on reciept.</param> public TrustAnchorResolver(IX509CertificateStore outgoingAnchors, IX509CertificateStore incomingAnchors) : this(new UniformCertificateResolver(outgoingAnchors), new UniformCertificateResolver(incomingAnchors)) { }
/// <summary> /// Initializes an instance with a store of trust anchors used across both incoming and outgoing messages. /// </summary> /// <param name="anchors">The store of trust anchors for this resolver.</param> public TrustAnchorResolver(IX509CertificateStore anchors) : this(anchors, anchors) { }
void InstallCerts(IX509CertificateStore store, IEnumerable<X509Certificate2> certs) { foreach (X509Certificate2 cert in certs) { if (!store.Contains(cert)) { WriteLine("Installing {0} HasPrivateKey={1}", cert.ExtractEmailNameOrName(), cert.HasPrivateKey); store.Add(cert); } } }
/// <summary> /// Initializes an instance with a store of certificates that may be used /// for the organization. /// </summary> /// <param name="certs">The certificates to use for the organization.</param> public UniformCertificateResolver(IX509CertificateStore certs) : this(certs.GetAllCertificates()) { }