01: package org.bouncycastle.jce.provider;
02:
03: import org.bouncycastle.util.CollectionStore;
04: import org.bouncycastle.util.Selector;
05: import org.bouncycastle.x509.X509CollectionStoreParameters;
06: import org.bouncycastle.x509.X509StoreParameters;
07: import org.bouncycastle.x509.X509StoreSpi;
08:
09: import java.util.Collection;
10:
11: public class X509StoreAttrCertCollection extends X509StoreSpi {
12: private CollectionStore _store;
13:
14: public X509StoreAttrCertCollection() {
15: }
16:
17: public void engineInit(X509StoreParameters params) {
18: if (!(params instanceof X509CollectionStoreParameters)) {
19: throw new IllegalArgumentException(params.toString());
20: }
21:
22: _store = new CollectionStore(
23: ((X509CollectionStoreParameters) params)
24: .getCollection());
25: }
26:
27: public Collection engineGetMatches(Selector selector) {
28: return _store.getMatches(selector);
29: }
30: }
|