Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to retrieve public/ private from iKey token using Sun PKCS#11 provider

843810Dec 20 2004 — edited Dec 15 2008
Dear all,

I'm trying to access one rainbow iKey 2032 token in Java 1.5 (Windows Environment) using Sun PKCS#11 provider. Token is stored with certificate. There is no problem to logging into the token using java.

Provider p = new sun.security.pkcs11.SunPKCS11(configName);
Security.addProvider(p);

KeyStore ks = null;
try{
char[] pin = {'P','A','S','S','W','O','R','D'};
ks = KeyStore.getInstance("pkcs11");
ks.load(null,pin);
}
catch(Exception e) {}

Now I am wondering how to retrieve a public and private from token, so that I can encrypt and decrypt a plain text file. Could anyone give me a sample program for this?

Your help is very much appreciated!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 12 2009
Added on Dec 20 2004
20 comments
2,430 views