in net/JetBrains.SignatureVerifier/src/Crypt/BcExt.cs [60:105]
public static List<string> GetCrlDistributionUrls(this X509Certificate cert)
{
var res = new List<string>();
var crldp = CrlDistPoint.FromExtensions(cert.CertificateStructure.TbsCertificate.Extensions);
if (crldp != null)
{
DistributionPoint[] dps = null;
try
{
dps = crldp.GetDistributionPoints();
}
catch (Exception e)
{
throw new Exception(
"Distribution points could not be read.", e);
}
for (int i = 0; i < dps.Length; i++)
{
DistributionPointName dpn = dps[i].DistributionPointName;
// look for URIs in fullName
if (dpn != null)
{
if (dpn.Type == DistributionPointName.FullName)
{
GeneralName[] genNames = GeneralNames.GetInstance(
dpn.Name).GetNames();
// look for an URI
for (int j = 0; j < genNames.Length; j++)
{
if (genNames[j].TagNo == GeneralName.UniformResourceIdentifier)
{
string location = DerIA5String.GetInstance(
genNames[j].Name).GetString();
res.Add(location);
}
}
}
}
}
}
return res;
}