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!

PKCS12 and Bouncy Castle (setKeyEntry no password support?)

843811Apr 29 2008 — edited May 4 2008
The problem iss that i can get the private key with a wrong passwd... Dont know where my error is...
Any suggestions?
X509Certificate[] chain ={ createV3Cert(keypair,"userid")};
KeyStore pkcs12KeyStore = null;
pkcs12KeyStore = KeyStore.getInstance("PKCS12", "BC");
pkcs12KeyStore.load(null, null);
pkcs12KeyStore.setKeyEntry("userid", keypair.getPrivate(), "rightpass".toCharArray(), chain);
pkcs12KeyStore.getKey("userid", "wrongpass".toCharArray()); //gets the same private key :-/ and no exceptions that passwd iss wrong
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2008
Added on Apr 29 2008
6 comments
1,628 views