throw new UnsupportedConstraintException(
"principal not allowed: " + p);
}
Certificate cert = getCertificate(p);
if (cert == null) {
throw new DiscoveryProtocolException(
"unknown principal: " + p);
}
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, "mapped principal {0} to {1}",
new Object[]{ p, cert });
}
if (checker != null) {
checker.checkClientSubject(new Subject(
true,
Collections.singleton(p),
Collections.singleton(cert),
Collections.EMPTY_SET));
}
if (!verify(signed.duplicate(), signature.duplicate(),
cert.getPublicKey())) {
throw new DiscoveryProtocolException(
"signature verification failed: " + p);
}
} catch (IOException e) {
throw e;
} catch (SecurityException e) {
throw e;
} catch (Exception e) {
throw new DiscoveryProtocolException(null, e);
}
}