Skip to Main Content

Java Programming

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!

Is KeyStore thread safe?

807603Jan 29 2008 — edited Jan 30 2008
Hi all,

My class has KeyStore instance as static field.

When KeyStore#getKey(String alias, char[] password) mthod is called with right alias and password on multi-thread environment, normaly I can get Key object successfully.
But rarely following UnrecoverableKeyException is thrown from that method.
Caused by: java.security.UnrecoverableKeyException: Given final block not properly padded
	at com.sun.crypto.provider.SunJCE_z.a(DashoA13*..)
	at com.sun.crypto.provider.JceKeyStore.engineGetKey(DashoA13*..)
	at java.security.KeyStore.getKey(KeyStore.java:763)
Is KeyStore (specifically JceKeyStore) thread safe?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 27 2008
Added on Jan 29 2008
1 comment
1,509 views