Пример #1
0
 // Indexer using an OID friendly name or value.
 public Oid this[string oid] {
     get {
         // If we were passed the friendly name, retrieve the value string.
         string oidValue = X509Utils.FindOidInfoWithFallback(CAPI.CRYPT_OID_INFO_NAME_KEY, oid, OidGroup.All);
         if (oidValue == null)
         {
             oidValue = oid;
         }
         foreach (Oid entry in m_list)
         {
             if (entry.Value == oidValue)
             {
                 return(entry);
             }
         }
         return(null);
     }
 }
Пример #2
0
        internal Oid(string oid, OidGroup group, bool lookupFriendlyName)
        {
            if (lookupFriendlyName)
            {
                // If we were passed the friendly name, retrieve the value string.
                string oidValue = X509Utils.FindOidInfoWithFallback(CAPI.CRYPT_OID_INFO_NAME_KEY, oid, group);
                if (oidValue == null)
                {
                    oidValue = oid;
                }
                this.Value = oidValue;
            }
            else
            {
                this.Value = oid;
            }

            m_group = group;
        }