} catch (KeyException e) {
log.error("Error extracting DER-encoded key value", e);
throw new SecurityException("Error extracting DER-encoded key value", e);
}
KeyAlgorithmCriteria algorithmCriteria = criteriaSet.get(KeyAlgorithmCriteria.class);
if (algorithmCriteria != null && algorithmCriteria.getKeyAlgorithm() != null
&& !algorithmCriteria.getKeyAlgorithm().equals(pubKey.getAlgorithm())) {
log.debug("Criteria specified key algorithm {}, actually {}, skipping",
algorithmCriteria.getKeyAlgorithm(), pubKey.getAlgorithm());
return null;
}
BasicCredential cred = new BasicCredential();
cred.setPublicKey(pubKey);