RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v2]

Mat Carter duke at openjdk.java.net
Wed May 4 20:32:35 UTC 2022


On Wed, 4 May 2022 03:10:10 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   replace string parameter with int and supporting constants
>
> src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java line 256:
> 
>> 254:     private final KeyStoreLocation storeLocation;
>> 255: 
>> 256:     CKeyStore(String storeName, KeyStoreLocation storeLocation) {
> 
> Why not just an `int` here? The creation of a separate class `keyStoreLocation` seems not necessary. If you want code to be readable, just add `public static final int CURRENTUSER = 0`, etc.

I was using type safety to remove the chance of non-expected values being passed to the C function.  Implemented your recommendation as its a simple contract between two files

-------------

PR: https://git.openjdk.java.net/jdk/pull/8211



More information about the security-dev mailing list