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

[413 byte] By [RMichael75] at [2007-9-26 7:35:42]
# 1

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

vijayakumar21 at 2007-7-1 17:36:19 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2

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

amelin at 2007-7-1 17:36:19 > top of Java-index,Security,Other Security APIs, Tools, and Issues...