I do to decrypt and encrypt RSA, I use Cipher.getInstance("RSA/NONE/PKCS1Padding");
for it, and I added Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
and compile 'org.bouncycastle:bcprov-jdk16:1.45'
to gradle-file. So this project to run and work in Intellij Idea,
But if I generate .jar file and to run it, I have:
java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/PKCS1Padding
at javax.crypto.Cipher.getInstance(Cipher.java:540)
(generated .jar by ShadowJar task of gradle).
Why my project in Intellij Idea - work! And in .jar-file - does not work?