9

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.

Sergiu
  • 2,502
  • 6
  • 35
  • 57

1 Answers1

9

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, EMAILADDRESS=your.name@example.com, C=UK"
Jcs
  • 13,279
  • 5
  • 53
  • 70
  • Thanks, this worked very well for getting the "Email Address" field populated for public key certificates exported and used on the OSX operating system, making it easier to find a custom imported certificate (Since Apple only supports searching on name and email via command line, and name can often be ambiguous), i.e. `security find-certificate -e your.name@example.com`. – tresf May 13 '15 at 00:28