コード例 #1
0
        private X509Certificate2 GetADRecipientCert(ADRawEntry adrecipient)
        {
            byte[][] array = CertificateManager.FindCertificatesForADRecipient(adrecipient);
            if (array.Length == 0)
            {
                return(null);
            }
            ProxyAddressCollection proxyAddressCollection = adrecipient[ADRecipientSchema.EmailAddresses] as ProxyAddressCollection;
            List <string>          list = new List <string>(proxyAddressCollection.Count);
            int num = 0;

            while (proxyAddressCollection != null && num < proxyAddressCollection.Count)
            {
                list.Add(proxyAddressCollection[num].AddressString);
                num++;
            }
            return(this.FindBestCertificate(array, list, false));
        }