protected static boolean isNotEmpty(Collection<?> col) { return CollectionUtil.isNonEmpty(col); }
private P11SinglePasswordRetriever(Set<P11SlotIdFilter> slots, List<String> passwords) { this.slots = slots; this.passwords = CollectionUtil.isEmpty(passwords) ? null : passwords; }
public void setProfiles(Set<String> profiles) { if (CollectionUtil.isEmpty(profiles)) { this.profiles = Collections.emptySet(); } else { this.profiles = CollectionUtil.unmodifiableSet(CollectionUtil.toLowerCaseSet(profiles)); } }
public void setProfiles(Set<String> profiles) { this.profiles = CollectionUtil.unmodifiableSet(CollectionUtil.toLowerCaseSet(profiles)); }
public GeneralNameMode(GeneralNameTag tag, Set<ASN1ObjectIdentifier> allowedTypes) { this.tag = Args.notNull(tag, "tag"); this.allowedTypes = CollectionUtil.isEmpty(allowedTypes) ? Collections.emptySet() : CollectionUtil.unmodifiableSet(allowedTypes); }
public static AuthorityInformationAccess createAuthorityInformationAccess( List<String> caIssuerUris, List<String> ocspUris) { if (CollectionUtil.isEmpty(caIssuerUris) && CollectionUtil.isEmpty(ocspUris)) { throw new IllegalArgumentException("caIssuerUris and ospUris may not be both empty"); } List<AccessDescription> accessDescriptions = new ArrayList<>(ocspUris.size()); if (CollectionUtil.isNonEmpty(caIssuerUris)) { for (String uri : caIssuerUris) { GeneralName gn = new GeneralName(GeneralName.uniformResourceIdentifier, uri); accessDescriptions.add( new AccessDescription(X509ObjectIdentifiers.id_ad_caIssuers, gn)); } } if (CollectionUtil.isNonEmpty(ocspUris)) { for (String uri : ocspUris) { GeneralName gn = new GeneralName(GeneralName.uniformResourceIdentifier, uri); accessDescriptions.add(new AccessDescription(X509ObjectIdentifiers.id_ad_ocsp, gn)); } } DERSequence seq = new DERSequence(accessDescriptions.toArray(new AccessDescription[0])); return AuthorityInformationAccess.getInstance(seq); }
@Override public void clearPublishQueue(String caName, List<String> publisherNames) throws CaMgmtException { asssertMasterMode(); publisherNames = CollectionUtil.toLowerCaseList(publisherNames); if (caName == null) { if (CollectionUtil.isNonEmpty(publisherNames)) { throw new IllegalArgumentException("non-empty publisherNames is not allowed"); } try { certstore.clearPublishQueue((NameId) null, (NameId) null); } catch (OperationException ex) { throw new CaMgmtException(ex.getMessage(), ex); } return; } caName = caName.toLowerCase(); X509Ca ca = x509cas.get(caName); if (ca == null) { throw new CaMgmtException(concat("could not find CA named ", caName)); } ca.clearPublishQueue(publisherNames); } // method clearPublishQueue
if (mechFilters != null && CollectionUtil.isNonEmpty(mechFilters)) { for (Pkcs11conf.MechanimFilter filterType : mechFilters) { Set<P11SlotIdFilter> slots = getSlotIdFilters(filterType.getSlots()); if (passwordsList != null && CollectionUtil.isNonEmpty(passwordsList)) { passwordRetriever.setPasswordResolver(passwordResolver); for (Pkcs11conf.PasswordSet passwordType : passwordsList) { for (Pkcs11conf.NativeLibrary library : moduleType.getNativeLibraries()) { List<String> osNames = library.getOperationSystems(); if (CollectionUtil.isEmpty(osNames)) { nativeLibraryPath = library.getPath(); } else {
public void setProfiles(Set<String> profiles) { this.profiles = CollectionUtil.unmodifiableSet(CollectionUtil.toLowerCaseSet(profiles)); }
private SingleRetriever(Set<P11SlotIdFilter> slots, List<String> passwords) { this.slots = slots; this.passwords = CollectionUtil.isEmpty(passwords) ? null : passwords; }
protected static boolean isNotEmpty(Collection<?> col) { return CollectionUtil.isNonEmpty(col); }
if (mechFilters != null && CollectionUtil.isNonEmpty(mechFilters.getMechanismFilter())) { for (MechanismFilterType filterType : mechFilters.getMechanismFilter()) { Set<P11SlotIdFilter> slots = getSlotIdFilters(filterType.getSlots()); if (passwordsList != null && CollectionUtil.isNonEmpty(passwordsList.getPasswords())) { passwordRetriever.setPasswordResolver(passwordResolver); for (PasswordsType passwordType : passwordsList.getPasswords()) { for (NativeLibraryType library : moduleType.getNativeLibraries().getNativeLibrary()) { List<String> osNames = library.getOs(); if (CollectionUtil.isEmpty(osNames)) { nativeLibraryPath = library.getPath(); } else {
public void setProfiles(Set<String> profiles) { if (CollectionUtil.isEmpty(profiles)) { this.profiles = Collections.emptySet(); } else { this.profiles = CollectionUtil.unmodifiableSet(CollectionUtil.toLowerCaseSet(profiles)); } }
private SingleFilter(Set<P11SlotIdFilter> slots, Collection<Long> mechanisms) { this.slots = slots; this.mechanisms = CollectionUtil.isEmpty(mechanisms) ? null : mechanisms; }
@Override public void run() { if (inProcess.get()) { return; } inProcess.set(true); try { // just updated within the last 2 minutes if (System.currentTimeMillis() - lastUpdate < 2 * MINUTE) { return; } LOG.info("scheduled configuring CAs {}", autoConfCaNames); Set<String> failedCaNames = autoConfCas(autoConfCaNames); if (CollectionUtil.isNonEmpty(failedCaNames)) { LOG.warn("could not configure following CAs {}", failedCaNames); } } finally { lastUpdate = System.currentTimeMillis(); inProcess.set(false); } }
if (CollectionUtil.isEmpty(conf.getCas())) { LOG.warn("no CA is configured"); Set<String> failedCaNames = autoConfCas(autoConfCaNames); if (CollectionUtil.isNonEmpty(failedCaNames)) { LOG.error("could not configure following CAs {}", failedCaNames); return false;
@Override public X509Certificate getCertificate() { return CollectionUtil.isEmpty(certificateChain) ? null : certificateChain[0]; }
NameIdStore(String table, Map<String, Integer> entries) { this.table = Args.notNull(table, "table"); this.entries = new HashMap<>(); if (CollectionUtil.isNonEmpty(entries)) { for (String name : entries.keySet()) { addEntry(name, entries.get(name)); } } }
private P11SingleMechanismFilter(Set<P11SlotIdFilter> slots, Collection<Long> mechanisms) { this.slots = slots; this.mechanisms = CollectionUtil.isEmpty(mechanisms) ? null : mechanisms; }
private static String toString(Set<ASN1ObjectIdentifier> oids) { if (oids == null) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append("["); for (ASN1ObjectIdentifier oid : oids) { String name = ObjectIdentifiers.getName(oid); if (name != null) { sb.append(name); sb.append(" (").append(oid.getId()).append(")"); } else { sb.append(oid.getId()); } sb.append(", "); } if (CollectionUtil.isNonEmpty(oids)) { int len = sb.length(); sb.delete(len - 2, len); } sb.append("]"); return sb.toString(); } // method toString