问题描述
我需要使用完全PKCS#1 V2.0加密方法(在)。
I need encrypt data using exactly the PKCS#1 V2.0 encryption method (defined in item 7.2.1 of the PKCS#1V2 specification).
Java已经实现了吗?
Is it already implemented for Java?
我正在考虑一些事情,例如将参数传递给指定PKCS#1V2的javax.crypto.Cipher,我想知道是否有这样的东西?
I'm thinking in something like just pass a parameter to javax.crypto.Cipher specifying "PKCS#1V2", I wonder if there is something like this?
推荐答案
PKCS#1 v2.0加密通常称为OAEP加密。所以:
PKCS#1 v2.0 encryption is usually called OAEP encryption. So:
Cipher.getInstance("RSA/ECB/OAEPWithSHA1AndMGF1Padding");
要查看的地方是Java加密体系结构文档:或。
The place to look is the Java Cryptography Architecture documents: Standard Algorithm Name Documentation or Sun Providers Documentation.
您可以看到SunJCE提供商支持OAEP的以下变体:
As you can see the SunJCE provider supports the following variations of OAEP:
- OAEPWITHMD5ANDMGF1PADDING
- OAEPWITHSHA1ANDMGF1PADDING
- (OAEPWITHSHA-1ANDMGF1PADDING)
- OAEPWITHSHA-256ANDMGF1PADDING
- OAEPWITHSHA-384ANDMGF1PADDING
- OAEPWITHSHA-512ANDMGF1PADDING
- OAEPWITHMD5ANDMGF1PADDING
- OAEPWITHSHA1ANDMGF1PADDING
- (OAEPWITHSHA-1ANDMGF1PADDING)
- OAEPWITHSHA-256ANDMGF1PADDING
- OAEPWITHSHA-384ANDMGF1PADDING
- OAEPWITHSHA-512ANDMGF1PADDING
这篇关于PKCS#1 V2.0是否实现了Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!