Thursday, 31 January 2013
Using ikeycmd with spaces in the -label parameter
This one gave me loads of bother.. but I worked it out eventually :-)
Here's the problem..
Normally, when you want to look at the details of a keystore entry you run
/opt/ihs/java/jre/bin/ikeycmd -cert -details -label myLabel -db /tmp/myKeystore.kdb -pw myPasword
However, if somebody has imported a cert without specifying a label, the DN will be used as a default label, which invariably contains spaces. 'OK' you might thing, 'a couple of quotes will do nicely' ... not true!. I tried every combination of quotes, brackets and backslashes know to man or martian and none of them worked.
In the end, this article gave me the vital clue http://publib.boulder.ibm.com/httpserv/ihsdiag/gather_certificate_doc.html (search for the word parameter within) and running the java command directly as opposed to via the wrapper script (which is all ikeycmd is) did the trick.. see example below
/opt/ihs/java/jre/bin/java -ms8m com.ibm.gsk.ikeyman.ikeycmd -cert -details -label 'CN=bobclarke.co.uk, OU=PKI, O=London Town C=GB' -db /tmp/myKeystore.kdb
NOTE: you still need to put single quotes around the label
Subscribe to:
Post Comments (Atom)
Bob thanks for the info. I had some of my precious :) time wasted trying to make this thing run.
ReplyDelete