internal static byte[] GetExtensionValueByOid(X509Certificate certificate, String oid) { Asn1OctetString extensionValue = certificate.GetExtensionValue(oid); return(extensionValue != null?extensionValue.GetDerEncoded() : null); }