Which can I choose for digital signature, Cipher.MODE_ENCRYPT or Cipher.MODE_DECRYPT?
Posted: Mon Mar 21, 2016 4:04 am
I have used this code line to initialize RSA cipher.
which is initialized as:
Now my question is I am not sure which parameter to select between Cipher.MODE_ENCRYPT and Cipher.MODE_DECRYPT to generate digital signature. Any one knows? Pls help! Any comment is appreciated.
Code: Select all
crypto.rsaCipher.init(keyStore.cardPrivateKey, Cipher.MODE_DECRYPT);
which is initialized as:
Code: Select all
rsaCipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
Now my question is I am not sure which parameter to select between Cipher.MODE_ENCRYPT and Cipher.MODE_DECRYPT to generate digital signature. Any one knows? Pls help! Any comment is appreciated.