How do you parse the Subject Alternate Names from an X509Certificate2?

Posted by Ishan7 under C# on 1/29/2021 | Points: 10 | Views : 2448 | Status : [Member] | Replies : 0
Is there an easy way to get the Subject Alternate Names from an X509Certificate2 object?

foreach (X509Extension ext in certificate.Extensions)
{
if (ext.Oid.Value.Equals(/* SAN OID */"2.5.29.17"))
{
byte[] raw = ext.RawData;
// ?????? parse to get type and name ????????
}
}





Responses

(No response found.)

Login to post response