Apple Security Provider.
Sean Mullan
sean.mullan at oracle.com
Wed May 2 11:47:01 PDT 2012
On 05/01/2012 08:34 PM, Michael Hall wrote:
>
>>>>
>>>>
>>>
>>> I believe we did port over the KeyChain provider, but not the entirely of the Apple provider (since it was based on deprecated API).
>
> It is there...
>
> KeyStore
> implementors:
> CaseExactJKS
> JCEKS
> KeychainStore
> PKCS12
> JKS
>
> But doesn't appear to work the same? As shown in my prior. The original implementation didn't require a load call to initialize it, but now....
>
> import java.security.*;
> import java.util.Enumeration;
>
> public class KeyStoreTester {
>
> public static void main(String[] args) {
> try {
> KeyStore ks = KeyStore.getInstance("KeychainStore");
> System.out.println(ks.getProvider());
> Enumeration<String> e = ks.aliases();
> while (e.hasMoreElements())
> System.out.println(e.nextElement());
> }
> catch (Exception ex) { ex.printStackTrace(); }
> }
>
> }
>
> /usr/libexec/java_home -v 1.7 --exec java KeyStoreTester
> Apple version 1.1
> java.security.KeyStoreException: Uninitialized keystore
> at java.security.KeyStore.aliases(KeyStore.java:1002)
> at KeyStoreTester.main(KeyStoreTester.java:10)
>
>
> It seems to need you to? I can probably figure out what file to use for the load. Is that actually supposed to be required now?
>
Try specifying null for the InputStream parameter. I am not familiar
with the OS X implementation, but it sounds like that may have been a
bug - according to the KeyStore API, in order to access a KeyStore, you
first have to initialize it by calling the load method.
--Sean
More information about the macosx-port-dev
mailing list