/** * Wrap an existing initialised {@link KeyStore} with an wrapper to filter which aliases can be returned. * * @param toWrap the {@link KeyStore} to wrap. * @return the filtering wrapper around the {@link KeyStore} * @throws NoSuchAlgorithmException * @throws CertificateException * @throws IOException * @throws IllegalArgumentException if the {@link KeyStore} being wrapped is {@code null} */ public static KeyStore filteringKeyStore(final KeyStore toWrap, final Predicate<String> aliasPredicate) throws NoSuchAlgorithmException, CertificateException, IOException { Assert.checkNotNullParam("toWrap", toWrap); KeyStore keyStore = new FilteringKeyStore(new FilteringKeyStoreSpi(toWrap, aliasPredicate), toWrap.getProvider(), toWrap.getType()); keyStore.load(null, null); return keyStore; }
/** * Wrap an existing initialised {@link KeyStore} with an wrapper to filter which aliases can be returned. * * @param toWrap the {@link KeyStore} to wrap. * @return the filtering wrapper around the {@link KeyStore} * @throws NoSuchAlgorithmException * @throws CertificateException * @throws IOException * @throws IllegalArgumentException if the {@link KeyStore} being wrapped is {@code null} */ public static KeyStore filteringKeyStore(final KeyStore toWrap, final Predicate<String> aliasPredicate) throws NoSuchAlgorithmException, CertificateException, IOException { Assert.checkNotNullParam("toWrap", toWrap); KeyStore keyStore = new FilteringKeyStore(new FilteringKeyStoreSpi(toWrap, aliasPredicate), toWrap.getProvider(), toWrap.getType()); keyStore.load(null, null); return keyStore; }
/** * Wrap an existing initialised {@link KeyStore} with an wrapper to filter which aliases can be returned. * * @param toWrap the {@link KeyStore} to wrap. * @return the filtering wrapper around the {@link KeyStore} * @throws NoSuchAlgorithmException * @throws CertificateException * @throws IOException * @throws IllegalArgumentException if the {@link KeyStore} being wrapped is {@code null} */ public static KeyStore filteringKeyStore(final KeyStore toWrap, final Predicate<String> aliasPredicate) throws NoSuchAlgorithmException, CertificateException, IOException { Assert.checkNotNullParam("toWrap", toWrap); KeyStore keyStore = new FilteringKeyStore(new FilteringKeyStoreSpi(toWrap, aliasPredicate), toWrap.getProvider(), toWrap.getType()); keyStore.load(null, null); return keyStore; }
/** * Wrap an existing initialised {@link KeyStore} with an wrapper to filter which aliases can be returned. * * @param toWrap the {@link KeyStore} to wrap. * @return the filtering wrapper around the {@link KeyStore} * @throws NoSuchAlgorithmException * @throws CertificateException * @throws IOException * @throws IllegalArgumentException if the {@link KeyStore} being wrapped is {@code null} */ public static KeyStore filteringKeyStore(final KeyStore toWrap, final Predicate<String> aliasPredicate) throws NoSuchAlgorithmException, CertificateException, IOException { Assert.checkNotNullParam("toWrap", toWrap); KeyStore keyStore = new FilteringKeyStore(new FilteringKeyStoreSpi(toWrap, aliasPredicate), toWrap.getProvider(), toWrap.getType()); keyStore.load(null, null); return keyStore; }