[英]How to use RSA_PKCS1_OAEP_PADDING encrypt in Java
In Java,how to use RSA_PKCS1_OAEP_PADDING to encrypt?在 Java 中,如何使用 RSA_PKCS1_OAEP_PADDING 进行加密? when i use this below ,it shows "javax.crypto.NoSuchPaddingException:RSA/ECB/OAEPPadding unavailable with RSA".
当我在下面使用它时,它显示“javax.crypto.NoSuchPaddingException:RSA/ECB/OAEPPadding 对 RSA 不可用”。
cipher = Cipher.getInstance("RSA/ECB/OAEPPadding", provider); cipher = Cipher.getInstance("RSA/ECB/OAEPPadding", 提供者);
Can you tell me the correct answer?thanks!你能告诉我正确的答案吗?谢谢!
Try without specifying a provider, that is:尝试不指定提供者,即:
cipher = Cipher.getInstance("RSA/ECB/OAEPPadding");
If you want to use a specific provider, provide more information about which provider you are using, and what evidence you have that the provider supports OAEP padding.如果您想使用特定的提供程序,请提供有关您正在使用的提供程序的更多信息,以及您有什么证据表明该提供程序支持 OAEP 填充。
There is meta-data in the provider itself about the services it provides and their details.提供者本身有关于它提供的服务及其详细信息的元数据。 We can look into that further if needed, but I think the answer here is simply that this provider doesn't make any provision for OAEP.
如果需要,我们可以进一步研究,但我认为这里的答案很简单,即该提供商没有为 OAEP 做出任何规定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.