<div dir="ltr">Thanks with that an the snippet from Leonard and Marc I have all what I need I thin;k. I will try later today to mix that. One thing I am not sure to understand is how this certificate is created and how you did find the information about it. Is there any place I should read for it?<div><br></div><div><br></div><div>Benoit</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 9, 2020 at 9:23 AM Roger Lipscombe <<a href="mailto:roger@differentpla.net">roger@differentpla.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">This is probably not complete (because we generate our own<br>
certificates), but here's what we use:<br>
<br>
-include_lib("public_key/include/public_key.hrl").<br>
<br>
get_certificate_subject_cn(#'OTPCertificate'{tbsCertificate = OTPTBS}) -><br>
    get_certificate_subject_cn(OTPTBS);<br>
get_certificate_subject_cn(#'OTPTBSCertificate'{subject = Subject}) -><br>
    get_cn(Subject).<br>
<br>
get_cn({rdnSequence, Seq}) -><br>
    get_cn(Seq);<br>
get_cn([]) -><br>
    undefined;<br>
get_cn([[#'AttributeTypeAndValue'{type = ?'id-at-commonName',<br>
                                  value = {utf8String, Value}}] | _]) -><br>
    Value;<br>
get_cn([_|Rest]) -><br>
    get_cn(Rest).<br>
<br>
get_serial_number(#'OTPCertificate'{tbsCertificate = OTPTBS}) -><br>
    get_serial_number(OTPTBS);<br>
get_serial_number(#'OTPTBSCertificate'{serialNumber = SerialNumber}) -><br>
    SerialNumber.<br>
<br>
On Sun, 8 Mar 2020 at 23:34, Benoit Chesneau <<a href="mailto:bchesneau@gmail.com" target="_blank">bchesneau@gmail.com</a>> wrote:<br>
><br>
> How can I get informations about an SSL certificate ? Specifically I am looking for a way to retrieve the issuer, subject, and the  serial number of the certificate.<br>
><br>
> The record I get from decoding using public_key functions is hard to parse so any help is welcome. Maybe there is already an api/app somewhere for it?<br>
><br>
> Benoît<br>
><br>
><br>
</blockquote></div>