extracting subjectAltName

Fredrik Thulin <>
Mon Sep 26 16:35:39 CEST 2005


If I have a certificate structure returned by ssl:peercert/2, how do I 
extract the subjectAltName(s)?

It seems that subjectAltName is an extension that is stored in the 
'extensions' element of a 'TBSCertificate' record, which is in turn 
part of the 'Certificate' record returned by 
	ssl:peercert(Socket, [pkix]).

I find various encoding/decoding functions for certificates among the 
SSL sources - some of which actually looks like they know what the 
subjectAltName extension is. However I can't seem to find the right one 
that extracts the extension I'm interested in, so I would be very 
thankful for some help.

Thanks in advance

/Fredrik



More information about the erlang-questions mailing list