Asymmetric Encryption/Decryption
843810Jun 2 2003 — edited Jun 3 2003Hi 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