* @param locate
* @return
*/
public LocateResult handleLocateRequest(LocateRequest locate) {
try {
QueryKeyBinding keybinding = locate.getQueryKeyBinding();
String identifer = getSubjectDN(keybinding);
String[] aliases = null;
if (identifer == null) {
KeyInfo keyInfo = keybinding.getKeyInfo();
if (keyInfo != null) {
try {
KeyName keyName = keyInfo.itemKeyName(0);
if (keyName != null) {
aliases = new String[] { keyName.getKeyName() };
}
} catch (XMLSecurityException xme) {
throw new XKMSException(xme);
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("No SubjectDN is specified");
}
} else {
aliases = getAliasesForDN(identifer);
}
byte[] skiValue = getSKIValue(keybinding);
if (skiValue != null) {
String alias = getAliasForX509Cert(skiValue);
if (alias != null) {
aliases = new String[] { alias };
}
}
if (aliases == null || aliases.length == 0) {
throw new XKMSException("KeyNotFound");
}
List keyUsage = keybinding.getKeyUsage();
boolean digitalSigning = keyUsage.contains(KeyUsage.SIGNATURE);
boolean dataEncryption = keyUsage.contains(KeyUsage.ENCRYPTION);
List list = new ArrayList();
for (int i = 0; i < aliases.length; i++) {