Certificate generation with Keytool, I can't confirm personal data

0

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?

lorenzo-s

Posted 2012-02-06T19:56:56.863

Reputation: 191

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 – 2012-02-06T20:00:34.397

@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 – 2012-02-06T20:03:46.403

Can you just edit the first to fit what you are trying to do? – soandos – 2012-02-06T20:09:13.587

@soandos I'm trying. I let you know if it works when I test the certificate. – lorenzo-s – 2012-02-06T20:10:39.153

@soandos It worked. If you post an answer with that command line I will accept it. – lorenzo-s – 2012-02-06T20:19:16.537

Answers

1

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

soandos

Posted 2012-02-06T19:56:56.863

Reputation: 22 744