-
Enhancement
-
Resolution: Not an Issue
-
P3
-
None
-
7-pool
-
x86
-
windows
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8008655 | 6-pool | Unassigned | P3 | Closed | Future Project |
Consider the following code snippet
Cipher rsa = Cipher.getInstance("RSA","SunMSCAPI");
rsa.init(Cipher.ENCRYPT_MODE, privateKey);
The resulting Cipher is the same as if a corresponding publicKey was provided.
At CU's opinion using Cipher API for encryption with private key is not a common case but it is not a misuse of the API. SunJCE provider supports such scenario.
PKCS #7 signed data specification describes encryption with the private key
see http://www.ietf.org/rfc/rfc2315.txt
The request is to initialize Ciphers with the private key if a private key is provided in case of SunMSCAPI - encryption.
Cipher rsa = Cipher.getInstance("RSA","SunMSCAPI");
rsa.init(Cipher.ENCRYPT_MODE, privateKey);
The resulting Cipher is the same as if a corresponding publicKey was provided.
At CU's opinion using Cipher API for encryption with private key is not a common case but it is not a misuse of the API. SunJCE provider supports such scenario.
PKCS #7 signed data specification describes encryption with the private key
see http://www.ietf.org/rfc/rfc2315.txt
The request is to initialize Ciphers with the private key if a private key is provided in case of SunMSCAPI - encryption.
- backported by
-
JDK-8008655 Cipher in plain RSA signing treats private keys as public
- Closed
- relates to
-
JDK-6578658 Request for raw RSA (NONEwithRSA) Signature support in SunMSCAPI
- Closed
-
JDK-6888925 SunMSCAPI's Cipher can't use RSA public keys obtained from other sources.
- Closed