Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to generate a self-signed certificate in order to sign some source code. I use:

keytool -genkey -storepass mypass -alias lorenzos -keystore nbproject/private/keystore

Then I fill in personal data, but every time I confirm them, it asks me personal information again and again:

Specificare nome e cognome
 [Unknown]:  Lorenzo Stanco
Specificare il nome dell'unità aziendale
 [Unknown]:  N/A
Specificare il nome dell'azienda
 [Unknown]:  N/A
Specificare la località
 [Unknown]:  Modena, Italy
Specificare la provincia
 [Unknown]:  MO
Specificare il codice a due lettere del paese in cui si trova l'unità
 [Unknown]:  IT
Il dato CN=Lorenzo Stanco, OU=N/A, O=N/A, L="Modena, Italy", ST=MO, C=IT è corretto?
 [no]:  yes
Specificare nome e cognome
 [Lorenzo Stanco]:

I've tried also using None instead of N/A. I've got the same problem on my Ubuntu machine and on my Cygwin terminal in Windows.

Am I doing it wrong?

share|improve this question
Does keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US" -alias business -keypass kpi135 -keystore working/mykeystore -storepass ab987c -validity 180 work? or even just keytool -genkeypair? – soandos Feb 6 '12 at 20:00
@soandos The first one works and creates the file. The second one asks me for a password, then asks for personal details, and goes forever as I described above. – lorenzo-s Feb 6 '12 at 20:03
Can you just edit the first to fit what you are trying to do? – soandos Feb 6 '12 at 20:09
@soandos I'm trying. I let you know if it works when I test the certificate. – lorenzo-s Feb 6 '12 at 20:10
@soandos It worked. If you post an answer with that command line I will accept it. – lorenzo-s Feb 6 '12 at 20:19
up vote 1 down vote accepted

Just use: keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US" -alias business -keypass kpi135 -keystore working/mykeystore -storepass ab987c -validity 180 with the appropriate substitutions (change the name, date, etc, if you want).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.