Esempio n. 1
0
        // Indexer using an OID friendly name or value.
        public X509Extension 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.ExtensionOrAttribute);
                if (oidValue == null)
                {
                    oidValue = oid;
                }

                foreach (X509Extension extension in m_list)
                {
                    if (String.Compare(extension.Oid.Value, oidValue, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        return(extension);
                    }
                }
                return(null);
            }
        }