I encountered a strange issue while encrypting with RSA in javax crypto. I am using RSA/None/OAEPWITHSHA-256ANDMGF1PADDING
mode as follow:
Cipher cipher = Cipher.getInstance("RSA/None/OAEPWITHSHA-256ANDMGF1PADDING");
and it is working correctly in my spring boot project. But when I call the same function via main(String[] args)
in the same project, I am getting the issue
Cannot find any provider supporting RSA/None/OAEPWITHSHA-256ANDMGF1PADDING
. Again if I use RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING
I get the correct output(I don't want to use ECB as I know it has no use in the RSA algorithm).
Also, in my another spring boot project, I am getting the same above issue(this time not only main(String[] args)
but in the Spring Boot project itself as well).
Could anybody help me with this?