/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param provider the provider to use * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service == null) throw new NoSuchAlgorithmException(algorithm); return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); }
/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param providers supplier of provider instances to search. * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Supplier<Provider[]> providers) throws NoSuchAlgorithmException { checkNotNullParam("providers", providers); for (Provider provider : providers.get()) { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service != null) { return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); } } throw new NoSuchAlgorithmException(); }
/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param provider the provider to use * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service == null) throw new NoSuchAlgorithmException(algorithm); return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); }
/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param provider the provider to use * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service == null) throw new NoSuchAlgorithmException(algorithm); return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); }
/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param provider the provider to use * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service == null) throw new NoSuchAlgorithmException(algorithm); return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); }
/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param providers supplier of provider instances to search. * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Supplier<Provider[]> providers) throws NoSuchAlgorithmException { checkNotNullParam("providers", providers); for (Provider provider : providers.get()) { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service != null) { return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); } } throw new NoSuchAlgorithmException(); }
/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param providers supplier of provider instances to search. * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Supplier<Provider[]> providers) throws NoSuchAlgorithmException { checkNotNullParam("providers", providers); for (Provider provider : providers.get()) { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service != null) { return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); } } throw new NoSuchAlgorithmException(); }
/** * Get a {@code CredentialStore} instance. The returned CredentialStore object will implement the given algorithm. * * @param algorithm the name of the algorithm * @param providers supplier of provider instances to search. * @return a {@code CredentialStore} instance * @throws NoSuchAlgorithmException if the given algorithm has no available implementations */ public static CredentialStore getInstance(String algorithm, Supplier<Provider[]> providers) throws NoSuchAlgorithmException { checkNotNullParam("providers", providers); for (Provider provider : providers.get()) { final Provider.Service service = provider.getService(CREDENTIAL_STORE_TYPE, algorithm); if (service != null) { return new CredentialStore(provider, (CredentialStoreSpi) service.newInstance(null), algorithm); } } throw new NoSuchAlgorithmException(); }