Add e-mail to CSR generated with keytool

Sergiu picture Sergiu · Oct 22, 2012 · Viewed 8.5k times · Source

As per this : http://en.wikipedia.org/wiki/Certificate_signing_request the CSR can contain an email address.

My question is how can I add such e-mail address field considering I`m generating the CSR with keytool ?

Thank you.

Answer

Jcs picture Jcs · Dec 19, 2013

When generating the key pair you can pass the Distinguished Name as a parameter with the -dname flag and thus add the EMAILADDRESS attribute.

keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048 -dname "CN=Your Name, [email protected], C=UK"