Generating Key Pairs and Importing Public Key Certificates to a Trusted Keystore
Join the DZone community and get the full member experience.Join For Free
Generating Key Pairs
Use following command in command prompt to generate a keypair with a self-signed certificate
keytool -genkey -alias wookie -keylag RSA -keystore wookieKeystore.jks -keysize 4096
After -alias give the alias to be used for keys
-keylag give the algorithm to be used in key generation
-keystore give the name of the keystore with type .jks (You can give a path here to store the keystore in a desired place)
-keysize give the length for the generating key in bits
This will look something as follows:
That's all and you are having a key pair now. :)
In Aspects of Wookie, now you can sign Widgets using this keystore. But in order to get your widgets verified and deployed in Wookie server you needs to get your public key trusted by server directly or via a third party.
Generating .cer File
keytool -v -export -file keystore1.cer -keystore keystore1.jks -alias keystore1
Importing Public Key Certificates to a Trusted Keystore
keytool -import -alias keystore1 -file keystore1.cer -keystore wookieKeystore.jks
This post was by: Pushpalanka
Published at DZone with permission of Will Soprano. See the original article here.
Opinions expressed by DZone contributors are their own.