return null;
}
try {
if (storage == null) {
Object exArgs[] = { Constants._TAG_X509ISSUERSERIAL };
KeyResolverException ex =
new KeyResolverException("KeyResolver.needStorageResolver",
exArgs);
log.info("", ex);
throw ex;
}
int noOfISS = x509data.lengthIssuerSerial();
Iterator storageIterator = storage.getIterator();
while (storageIterator.hasNext()) {
X509Certificate cert = (X509Certificate)storageIterator.next();
XMLX509IssuerSerial certSerial = new XMLX509IssuerSerial(element.getOwnerDocument(), cert);
if (log.isDebugEnabled()) {
log.debug("Found Certificate Issuer: "
+ certSerial.getIssuerName());
log.debug("Found Certificate Serial: "
+ certSerial.getSerialNumber().toString());
}
for (int i=0; i<noOfISS; i++) {
XMLX509IssuerSerial xmliss = x509data.itemIssuerSerial(i);
if (log.isDebugEnabled()) {
log.debug("Found Element Issuer: "
+ xmliss.getIssuerName());
log.debug("Found Element Serial: "
+ xmliss.getSerialNumber().toString());
}
if (certSerial.equals(xmliss)) {
log.debug("match !!! ");
return cert;
}
log.debug("no match...");
}
}
return null;
} catch (XMLSecurityException ex) {
log.debug("XMLSecurityException", ex);
throw new KeyResolverException("generic.EmptyMessage", ex);
}
}