On 01/22/2014 01:38 PM, Craig Wickesser wrote:
> Thanks, that seems to be what I needed. I noticed when get the users
> certificate in Java, if I print out
> x509Certificate.getSubjectDN().toString() I get something like:
>
> cn=Wickesser Craig cwickesser,ou=something,ou=foo,o=blah,c=us
>
> whereas with Go, if print out
> request.TLS.PeerCertificates[0].Subject.CommonName I get:
>
> Wickesser Craig cwickesser
>
> is that "cn=", "ou="...something Java adds...or should I be able to get
> that same sort of string from Go?
the request.TLS.PeerCertificates[0].Subject is a
http://godoc.org/crypto/x509/pkix#Name
(i think)
and the common abbreviations used stand for:
cn is CommonName
ou is OrganizationalUnit
o is Organization
c is Country
so you are effectively able to get the same string from go.