public Principal authenticate(X509Certificate[] certs) {
if (certs == null || certs.length == 0) {
return null;
}
CallbackHandler callbackHandler = new CertificateChainCallbackHandler(certs);
String principalName = certs[0].getSubjectX500Principal().getName();
return authenticate(callbackHandler, principalName);
}