equal
deleted
inserted
replaced
911 */ |
911 */ |
912 public static KeyStore getInstance(String type, String provider) |
912 public static KeyStore getInstance(String type, String provider) |
913 throws KeyStoreException, NoSuchProviderException |
913 throws KeyStoreException, NoSuchProviderException |
914 { |
914 { |
915 Objects.requireNonNull(type, "null type name"); |
915 Objects.requireNonNull(type, "null type name"); |
916 if (provider == null || provider.length() == 0) |
916 if (provider == null || provider.isEmpty()) |
917 throw new IllegalArgumentException("missing provider"); |
917 throw new IllegalArgumentException("missing provider"); |
918 try { |
918 try { |
919 Object[] objs = Security.getImpl(type, "KeyStore", provider); |
919 Object[] objs = Security.getImpl(type, "KeyStore", provider); |
920 return new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type); |
920 return new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type); |
921 } catch (NoSuchAlgorithmException nsae) { |
921 } catch (NoSuchAlgorithmException nsae) { |