/// <summary> /// Gets the data from a custom certificate extension. [oid] /// </summary> /// <param name="extension">The extension to use.</param> /// <returns></returns> public static string GetCustomOIDValue(X509Extension extension) { ASN1Element element = new ASN1Element(extension.RawData, 0); return(ConvertHex(BitConverter.ToString(element.Value).Replace("-", "").Replace("00", ""))); }