if (log.isDebugEnabled()) {
log.debug("Added CRL distpoint: "+uri);
}
final ASN1EncodableVector vec = new ASN1EncodableVector();
vec.add(gn);
final GeneralNames gns = new GeneralNames(new DERSequence(vec));
final DistributionPointName dpn = new DistributionPointName(0, gns);
dpns.add(dpn);
}
}
// CRL issuer works much like Dist point URI. If separated by ; it is put in the same global distPoint as the URI,
// if there is more of one of them, the one with more is put in an own global distPoint.
final ArrayList<GeneralNames> issuers = new ArrayList<GeneralNames>();
if (StringUtils.isNotEmpty(crlissuer)) {
final StringTokenizer tokenizer = new StringTokenizer(crlissuer, ";", false);
while (tokenizer.hasMoreTokens()) {
final String issuer = tokenizer.nextToken();
final GeneralName gn = new GeneralName(new X509Name(issuer));
if (log.isDebugEnabled()) {
log.debug("Added CRL issuer: "+issuer);
}
final ASN1EncodableVector vec = new ASN1EncodableVector();
vec.add(gn);
final GeneralNames gns = new GeneralNames(new DERSequence(vec));
issuers.add(gns);
}
}
final ArrayList<DistributionPoint> distpoints = new ArrayList<DistributionPoint>();
if ( (!issuers.isEmpty()) || (!dpns.isEmpty()) ) {
int i = dpns.size();
if (issuers.size() > i) {
i = issuers.size();
}
for (int j = 0; j < i; j++) {
DistributionPointName dpn = null;
GeneralNames issuer = null;
if (dpns.size() > j) {
dpn = (DistributionPointName)dpns.get(j);
}
if (issuers.size() > j) {
issuer = (GeneralNames)issuers.get(j);