RSA加密的问题
我用的是bouncycastle的provider
Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
rsaCipher.init(Cipher.DECRYPT_MODE,sK); //sK 是一个PublicKey
rsaCipher.update("Hello World".getBytes("UTF8"));
byte[] cipheredText = rsaCipher.doFinal();
这段代码会产生一个NonePointException,DES算法用一样的方法加密就没问题。