Hi all,

While working on parsing x509 certificate subjects, I have noticed that 
emailAddress is added to the subject with "/" instead of ",". Is it the 
expected behavior? I was not able to find RFC that would regulate that, but it 
seems a bit strange.

In any case, what is the recommended way of parsing the subject to extract just 
the CN?

-----------------

10G:tmp alexander$  openssl req -new -x509 -days 3650 -nodes -out rs0-cert.pem 
-keyout rs0-cert.keyGenerating a 1024 bit RSA private key
.....++++++
............++++++
writing new private key to 'rs0-cert.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:TS
Common Name (e.g. server FQDN or YOUR name) []:Alex
Email Address []:a...@mongodb.com


10G:tmp alexander$ openssl x509 -text -noout -in /tmp/rs0-cert.pem | grep Subj
        Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, OU=TS, 
CN=Alex/emailAddress=a...@mongodb.com
        Subject Public Key Info:
            X509v3 Subject Key Identifier:


OpenSSL version is 1.0.1g.

Best Regards,
Alexander Komyagin




Reply via email to