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?

link|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 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 at 20:03
Can you just edit the first to fit what you are trying to do? – soandos Feb 6 at 20:09
@soandos I'm trying. I let you know if it works when I test the certificate. – lorenzo-s Feb 6 at 20:10
@soandos It worked. If you post an answer with that command line I will accept it. – lorenzo-s Feb 6 at 20:19
feedback

1 Answer

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).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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