日期:2014-05-17  浏览次数:20911 次

记一个java在64位windows上的BUG
package org.example.crypto;

import java.security.KeyStore;
import java.security.KeyStoreException;

public class LoadKeystore
{
    public static void main(String[] args) throws KeyStoreException
    {
        KeyStore keystore = KeyStore.getInstance("Windows-MY");
        System.out.println(keystore.aliases());
    }
}

?

exception 写道
Exception in thread "main" java.security.KeyStoreException: Windows-MY not found
at java.security.KeyStore.getInstance(KeyStore.java:587)
at org.example.crypto.LoadKeystore.main(LoadKeystore.java:10)
Caused by: java.security.NoSuchAlgorithmException: Windows-MY KeyStore not available
at sun.security.jca.GetInstance.getInstance(GetInstance.java:142)
at java.security.Security.getImpl(Security.java:659)
at java.security.KeyStore.getInstance(KeyStore.java:584)

?

sun 异常描述 写道
Bug ID: 6931562
Votes 0
Synopsis Support SunMSCAPI Security Provider in Windows 64-bit releases of JVM
Category jce:sunmscapi
Reported Against
Release Fixed 7(b142)
State 11-Closed, Unverified, bug
Priority: 3-Medium
Related Bugs 7035058
Submit Date 03-MAR-2010
Description A DESCRIPTION OF THE REQUEST :
JRE 1.6.0_u18, for 64-bit Windows Vista does not appear to contain the sun.security.mscapi.SunMSCAPI security provider. The classes, supporting DLL, and security provider mapping in the java.security policy file are absent.
At runtime, the security API reports that it cannot locate the Windows-MY keystore. Documentation for the SunMSCAPI Provider does not indicate that support is only available on certain Windows platforms.
http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunMSCAPI

The 32-bit distribution for the same version and operating system includes this feature.

If implementation is impossible, due to limitations of the host platform, treat this as a bug, for which the end product would be updated documentation to warn future engineers of the missing feature.

JUSTIFICATION :
Provide feature consistency between JVM implementations runnable on the same host platform. Provide upgrade-path for code written against 32-bit JVM features.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The 64-bit Windows JVM implementations should provide access to the Windows-MY and Windows-ROOT keystores.
ACTUAL -
JVM indicates that it cannot locate the Windows-MY keystore.

?
跟帖 写道
Submitted On 10-MAR-2011
tomasgarciameras It's very easy to compile sunmscapi.dll as a x64 Windows DLL with Microsoft Visual Studio. It works without problems.


Submitted On 10-MAR-2011
tomasgarciameras It's very easy to compile sunmscapi.dll as a x64 Windows DLL with Microsoft Visual Studio. It works without problems.


Submitted On 10-MAR-2011
tomasgarciameras It's very easy to compile sunmscapi.dll as a x64 Windows DLL with Microsoft Visual Studio. It works without problems.

?

?

??? 但采用JAVA7,oracle解决了这个BUG

?

?