List of usage examples for java.security.cert X509CertSelector setKeyUsage
public void setKeyUsage(boolean[] keyUsage)
From source file:mitm.application.djigzo.ws.impl.CACertStoreViewWSImpl.java
private CloseableIterator<? extends X509CertStoreEntry> getIterator(CACertStoreViewFilter filter) throws CertStoreException { X509CertSelector selector = new X509CertSelector(); /*/* w ww . ja v a2 s.co m*/ * Make sure we only get CA certificates */ selector.setBasicConstraints(0); Set<KeyUsageType> keyUsage = new HashSet<KeyUsageType>(); keyUsage.add(KeyUsageType.KEYCERTSIGN); if (filter == CACertStoreViewFilter.CRL_SIGN) { keyUsage.add(KeyUsageType.CRLSIGN); } selector.setKeyUsage(KeyUsageType.getKeyUsageArray(keyUsage)); return certStore.getCertStoreIterator(selector, MissingKeyAlias.NOT_ALLOWED, null, null); }