How tp generate Keystores , keys and certificates programatically...
Hi i need to manipulated the keys and certificates in a keystore.. Like generating keys, adding it to the keystore and generating certificates and importing certificates.. etc from a java program..
Can anyone pls help me with this .. Is there some pliece of sample code some where can you pls give me the address to it.. or can you pls mail me at mich112@hotmail.com
Thanks
Rajeev
hi ,
i read the following message from the JDC forum.
i am also having the requiremnet.
i need to the following
adding keys to the keystore and generating certificates and importing certificates.. etc from a java program.
how can i do that?
please help me.
Thanks
kumar
Hi i need to manipulated the keys and certificates in a keystore.. Like generating keys, adding it to the keystore and generating certificates and importing certificates.. etc from a java program..
Can anyone pls help me with this .. Is there some pliece of sample code some where can you pls give me the address to it.. or can you pls mail me at mich112@hotmail.com
Thanks
Rajeev
use keytool utility.
you can use keytool.exe or use the same with java class sun.security.tools.KeyTool
sample code to import a certificate :
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
String lParam [] = {"-import", "-alias",aAlias,"-file", aFileName,"keystore", aKeyStore, "-storepass",aStorePass,"-noprompt"};
sun.security.tools.KeyTool.main(lParam);