做些什么来解密和加密RSA支持RSA/NONE/PKCS1Padding,我用Cipher.getInstance("RSA/NONE/PKCS1Padding");
它,我加入Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
和compile 'org.bouncycastle:bcprov-jdk16:1.45'
到摇篮文件。所以这个项目运行和IntelliJ IDEA的工作,java.security.NoSuchAlgorithmException:找不到任何提供商的jar文件
但是,如果我生成.jar文件,并运行它,我有:
java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/PKCS1Padding
at javax.crypto.Cipher.getInstance(Cipher.java:540)
(由gradle产出的ShadowJar任务生成的.jar)。
为什么我的项目在Intellij Idea - 工作!并在.jar文件 - 不起作用?
相关:[RSA/NONE/PKCS1Padding给出的错误为java.security.NoSuchAlgorithmException](http://stackoverflow.com/questions/20961481/rsa-none-pkcs1padding-giving-error-as-java-security-nosuchalgorithmexception) –