1
package org.bouncycastle.jce.provider;
3
import org.bouncycastle.util.CollectionStore;
4
import org.bouncycastle.util.Selector;
5
import org.bouncycastle.x509.X509CollectionStoreParameters;
6
import org.bouncycastle.x509.X509StoreParameters;
7
import org.bouncycastle.x509.X509StoreSpi;
9
import java.util.Collection;
12
* This class is a collection based Bouncy Castle
13
* {@link org.bouncycastle.x509.X509Store} SPI implementation for certificate
16
* @see org.bouncycastle.x509.X509Store
17
* @see org.bouncycastle.x509.X509CertificatePair
19
public class X509StoreCertPairCollection extends X509StoreSpi
22
private CollectionStore _store;
24
public X509StoreCertPairCollection()
29
* Initializes this store.
31
* @param params The {@link X509CollectionStoreParameters}s for this store.
32
* @throws IllegalArgumentException if <code>params</code> is no instance of
33
* <code>X509CollectionStoreParameters</code>.
35
public void engineInit(X509StoreParameters params)
37
if (!(params instanceof X509CollectionStoreParameters))
39
throw new IllegalArgumentException(
40
"Initialization parameters must be an instance of "
41
+ X509CollectionStoreParameters.class.getName()
45
_store = new CollectionStore(((X509CollectionStoreParameters)params)
50
* Returns a colelction of certificate pairs which match the given
51
* <code>selector</code>.
53
* The returned collection contains
54
* {@link org.bouncycastle.x509.X509CertificatePair}s. The selector must be
55
* a {@link org.bouncycastle.x509.X509CertPairStoreSelector} to select
58
* @return A collection with matching certificate pairs.
60
public Collection engineGetMatches(Selector selector)
62
return _store.getMatches(selector);