{"id":5139,"date":"2015-08-16T20:19:24","date_gmt":"2015-08-16T12:19:24","guid":{"rendered":"http:\/\/rmohan.com\/?p=5139"},"modified":"2015-08-16T20:21:22","modified_gmt":"2015-08-16T12:21:22","slug":"gsk7cmd","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5139","title":{"rendered":"gsk7cmd"},"content":{"rendered":"<p>SSL Commands using GSK<\/p>\n<p>======================<br \/>\nexport PATH=\/opt\/IBMJava\/bin:\/usr\/local\/ibm\/gsk7\/bin:$PATH<br \/>\nexport<br \/>\nCLASSPATH=\/usr\/local\/ibm\/gsk7\/classes\/cfwk.zip:\/usr\/local\/ibm \/gsk7\/classes\/gsk7cls.jar:$CLASSPATH<\/p>\n<p>Any GSK cmd can be executed using:<br \/>\n==================================<br \/>\njava com.ibm.gsk.ikeyman.ikeycmd command<\/p>\n<p>Creating a new key DB with password:<br \/>\n====================================<br \/>\ngsk7cmd -keydb -create -db &lt;filename&gt; -pw &lt;password&gt; -type &lt;cms | jks |<br \/>\njceks | pks12&gt; -expire &lt;days&gt; -stash<\/p>\n<p>Creating a new key DB without the password:<br \/>\n===========================================<br \/>\ngsk7cmd -keydb -create -db &lt;filename&gt; -type &lt;cms | jks | jceks | pks12&gt;<\/p>\n<p>Changing the password: (stashing the passwords are done for the cms<br \/>\ndatabase only)<br \/>\n======================<br \/>\ngsk7cmd -keydb -changepw -db &lt;filename&gt;.kdb -pw &lt;password&gt; -new_pw<br \/>\n&lt;new_password&gt; -expire &lt;days&gt; -stash<\/p>\n<p>Displaying the expiry dates of the certs:(for the cms database only&#8230;value<br \/>\nof &#8216;0&#8217; means the password is not expiring)<br \/>\n=========================================<br \/>\ngsk7cmd -keydb -expiry -db filename.kdb -pw password<\/p>\n<p>Listing all the certs:<br \/>\n======================<br \/>\ngsk7cmd -cert -list &lt;CA | personal&gt; -db &lt;kdb-file&gt; -pw &lt;password&gt; -type<br \/>\n&lt;cms | jks | jceks | pks12&gt;<\/p>\n<p>Exporting the keys from one DB to another:<br \/>\n==========================================<br \/>\ngsk7cmd -cert -export -db &lt;filename&gt; -pw &lt;password&gt; -label &lt;label&gt; -type<br \/>\n&lt;cms | jks | jceks | pkcs12&gt; -target &lt;filename&gt; -target_pw &lt;password&gt;<br \/>\n-target_type &lt;cms | jks | jceks | pkcs12&gt;<\/p>\n<p>Importing the certs from one DB to another:<br \/>\n===========================================<br \/>\ngsk7cmd -cert -import -db|-file &lt;filename&gt; -pw &lt;password&gt; -label &lt;label&gt;]<br \/>\n[&gt; -type &lt;cms | JKS | JCEKS | pkcs12&gt; -new_label &lt;label&gt; -target &lt;filename&gt;<br \/>\n-target_pw &lt;password&gt; -target_type &lt;cms | JKS | JCEKS | pkcs12&gt;[ ]-pfx]<\/p>\n<p>Receiving the CA signed cert:<br \/>\n=============================<br \/>\ngsk7cmd -cert -receive -file &lt;filename&gt; -db &lt;filename&gt; -pw &lt;password&gt;<br \/>\n-format &lt;ascii | binary&gt; -label &lt;label&gt; -default_cert &lt;yes | no&gt;<\/p>\n<p>Default key in the DB:<br \/>\n======================<br \/>\ngsk7cmd -cert -getdefault -db &lt;dbname&gt; -pw &lt;password&gt;<\/p>\n<p>Listing the expired certs:<br \/>\n==========================<br \/>\ngsk7cmd -cert -list -expiry &lt;days&gt; -db &lt;filename&gt; -pw &lt;paswsword&gt; -type<br \/>\n&lt;type&gt;<\/p>\n<p>Showing the entire cert:<br \/>\n========================<br \/>\ngsk7cmd -cert -details -showOID -db &lt;filename&gt; -pw &lt;password&gt; -label<br \/>\n&lt;label&gt;<\/p>\n<p>Storing a CA cert:<br \/>\n==================<br \/>\ngsk7cmd -cert -details -showOID -db &lt;filename&gt; -pw &lt;password&gt; -label<br \/>\n&lt;label&gt;<\/p>\n<p>Create a CMS DB and stash the password:<br \/>\n=======================================<br \/>\ngsk7cmd -keydb -create -db &lt;path_to_db&gt;\/&lt;db_name&gt; -pw &lt;password&gt; -type cms<br \/>\n-expire &lt;days&gt; -stash<\/p>\n<p>To store the password after a CMS database has been created:<br \/>\n============================================================<br \/>\ngsk7cmd -keydb -stashpw -db &lt;db_name&gt; -pw &lt;password&gt;<\/p>\n<p>Command line invocation for the CMS database:<br \/>\n=============================================<br \/>\ngsk7cmd -keydb -changepw -db &lt;filename&gt; -pw &lt;password&gt; -new_pw<br \/>\n&lt;new_password&gt; -stash -expire &lt;days&gt;<\/p>\n<p>gsk7cmd -keydb -create -db &lt;filename&gt; -pw &lt;password&gt; -type &lt;cms&gt; -expire<br \/>\n&lt;days&gt; -stash<\/p>\n<p>gsk7cmd -keydb -stashpw -db &lt;filename&gt; -pw &lt;password&gt;<\/p>\n<p>gsk7cmd -cert -getdefault -db &lt;filename&gt; -pw &lt;password&gt;<\/p>\n<p>gsk7cmd -cert -modify -db &lt;filename&gt; -pw &lt;password&gt; -label &lt;label&gt; -trust<br \/>\n&lt;enable | disable&gt;<\/p>\n<p>gsk7cmd -cert -setdefault -db &lt;filename&gt; -pw &lt;password&gt; -label &lt;label&gt;<\/p>\n<p>LAZ commands:<br \/>\n=============<br \/>\nRemoving cert using gsk7cmd (personal or CA)<br \/>\ngsk7cmd -cert -delete -db &lt;kdb-file&gt; -pw &lt;password&gt; -label &lt;label&gt;<\/p>\n<p>Importing Personal using gsk7cmd<br \/>\ngsk7cmd -cert -import -file &lt;name&gt; -type pkcs12 -target &lt;kdb file&gt;<br \/>\n-target_pw &lt;passwd&gt;] -target_type &lt;cms | jks | jceks | pkcs12&gt;<\/p>\n<p>Importing CA using gsk7cmd<br \/>\ngsk7cmd -cert -add -db &lt;kdb-file&gt; -pw &lt;passwd&gt; -type &lt;cms | jks | jceks |<br \/>\npkcs12&gt; -label &lt;label&gt; -file &lt;name&gt;<\/p>\n<p>Exporting Personal to pcks12 file using gsk7cmd<br \/>\ngsk7cmd -cert -export -db &lt;kdb-file&gt; -pw &lt;password&gt; -label &lt;label&gt; -type<br \/>\n&lt;cms | pkcs12&gt; -target &lt;filename&gt; -target_pw &lt;password for the filename&gt;<br \/>\n-target_type &lt;cms | pkcs12&gt;<\/p>\n<p>Exporting CA to arm file using gsk7cmd<br \/>\ngsk7cmd -cert -extract -db &lt;kdb-file&gt; -pw &lt;password&gt; -label &lt;label&gt; -target<br \/>\n&lt;filename&gt; -format ascii<\/p>\n<p>Listing using gsk7cmd<br \/>\ngsk7cmd -cert -list &lt;CA | personal&gt; -db &lt;kdb-file&gt; -pw &lt;password&gt;<\/p>\n<p>Listing Details using gsk7cmd<br \/>\ngsk7cmd -cert -details -db &lt;kdb-file&gt; -pw &lt;password&gt; -label &lt;label&gt;<\/p>\n<p>creating the cert:<br \/>\ngsk7cmd -cert -create -db &lt;filename&gt; -pw &lt;password&gt; -label &lt;label&gt; -dn<br \/>\n&lt;distinguished_name&gt; -size &lt;1024 | 512 | 2048&gt; -x509version &lt;3 | 1 | 2&gt;<br \/>\n-expire &lt;days&gt; -san_dnsname &lt;DNS name value&gt;[,&lt;DNS name value&gt;]<br \/>\n\u2013san_emailaddr &lt;email address value&gt;[,&lt;email address value&gt;] \u2013san_ipaddr<br \/>\n&lt;IP address value&gt;[,&lt;IP address value&gt;]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSL Commands using GSK<\/p>\n<p>====================== export PATH=\/opt\/IBMJava\/bin:\/usr\/local\/ibm\/gsk7\/bin:$PATH export CLASSPATH=\/usr\/local\/ibm\/gsk7\/classes\/cfwk.zip:\/usr\/local\/ibm \/gsk7\/classes\/gsk7cls.jar:$CLASSPATH<\/p>\n<p>Any GSK cmd can be executed using: ================================== java com.ibm.gsk.ikeyman.ikeycmd command<\/p>\n<p>Creating a new key DB with password: ==================================== gsk7cmd -keydb -create -db &lt;filename&gt; -pw &lt;password&gt; -type &lt;cms | jks | jceks | pks12&gt; -expire &lt;days&gt; -stash<\/p>\n<p>Creating a new key DB without the password: [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5139"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5139"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5139\/revisions"}],"predecessor-version":[{"id":5140,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5139\/revisions\/5140"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}