if (cert == null) {
throw new XKMSException(XKMSException.FAILURE, "CertNotPresent");
}
if (verifyTrust(cert)) {
ValidateResult validateResult = XKMSUtil.createValidateResult();
buildResultType((RequestAbstractType) validateRequest,
(ResultType) validateResult);
String subjectDN = cert.getIssuerDN().getName();
BigInteger issuerSerial = cert.getSerialNumber();
String alias = getAliasForX509Cert(subjectDN, issuerSerial);
X509Certificate[] certs = getCertificates(alias);
KeyBinding keyBinding = XKMSUtil.createKeyBinding();
validateResult.addKeyBinding(keyBinding);
addKeyInfo(respondWith, alias, certs, keyBinding);
addKeyUsage(certs[0], keyBinding);
addStatus(true, keyBinding);
return validateResult;
} else {
ValidateResult result = XKMSUtil.createValidateResult();
buildResultType((RequestAbstractType) validateRequest,
(ResultType) result);
KeyBinding keybinding = XKMSUtil.createKeyBinding();
X509Certificate[] certs = new X509Certificate[] { cert };
addKeyInfo(validateRequest.getRespondWith(), null, certs,
keybinding);
addKeyUsage(certs[0], keybinding);
addStatus(false, keybinding);
result.addKeyBinding(keybinding);
return result;
}
} catch (XKMSException ex) {
ValidateResult resultType = XKMSUtil.createValidateResult();
buildFault(validateRequest, resultType, ex);
return resultType;
}
}