在整RSA加密的时候用testng测试没什么问题,但是一旦用postman传过来密文去调接口解密就报错
javax.crypto.BadPaddingException: Decryption error
at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:370) ~[na:1.8.0_312]
at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[na:1.8.0_312]
at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:370) ~[sunjce_provider.jar:1.8.0_312]
at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:404) ~[sunjce_provider.jar:1.8.0_312]
at javax.crypto.Cipher.doFinal(Cipher.java:2168) ~[na:1.8.0_312]
结果发现是密文中有+,然鹅springboot会给解析成空格,自然报错