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!

Asymmetric Encryption/Decryption

843810Jun 2 2003 — edited Jun 3 2003
Hi y'all,

I'm currently experimenting with en-/decryption.
I want to use keys of a standard keystore, like encrypt with private key and decrypt with public key (or vice versa).
My setup always yields:
java.security.NoSuchAlgorithmException: No such algorithm: DSA

Here's a code snippet (notice I used bouncycastle provider)
...
myKey = keyStore.getCertificate(inUID).getPublicKey();
myCipher = Cipher.getInstance(myKey.getAlgorithm(),"BC");
...
myCipher.init(Cipher.ENCRYPT_MODE, myKey);

Thanks,
Peter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2003
Added on Jun 2 2003
7 comments
372 views