EldoS | Feel safer!

Software components for data protection, secure storage and transfer

DNS SANS as a string

Posted: 12/01/2013 09:17:51
by Phil Grafter (Basic support level)
Joined: 11/20/2013
Posts: 4

I have created a certificate object using the following code:

sbbCert = new TElX509Certificate();

What I would like to do now is get a string of all the DNS type Subject Alt Names. So in other words, for the cert associated with this site I would get the string:

"eldos.com, www.eldos.com"

How would I do this?

Thank you very much

Posted: 12/01/2013 09:52:15
by Eugene Mayevski (Team)

Use something like this code to collect values:

if ((Certificate.Extensions.Included & SBX509Ext.Global.ceSubjectAlternativeName) == SBX509Ext.Global.ceSubjectAlternativeName)
      TElAlternativeNameExtension AltName = Certificate.Extensions.SubjectAlternativeName;
      if (AltName.Content.Count > 0)
        String Name;    
        int i = 0;
        // check the domain names
            i = AltName.Content.FindNameByType(TSBGeneralName.gnDNSName, i);
            if (i != -1)
              Name = AltName.Content.get_Names(i).DNSName;
              if (we like the name)
          while (i != -1);

Sincerely yours
Eugene Mayevski
Posted: 12/01/2013 09:58:43
by Phil Grafter (Basic support level)
Joined: 11/20/2013
Posts: 4

Thank you very much for the excellent support Eugene!!!

Kind Regards



Topic viewed 431 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!