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