public void validate(Credential credential) {
MDCBuilder.buildMdcContext(credential);
try {
SshRsaCrypto rsa = new SshRsaCrypto();
PublicKey publicKey = rsa.readPublicKey(rsa.slurpPublicKey(credential.getPublicKey()));
} catch (Exception e) {
String errorMessage = String.format("Could not validate publickey certificate [certificate: '%s'], detailed message: %s",
credential.getPublicKey(), e.getMessage());
LOGGER.error(errorMessage, e);
throw new BadRequestException(errorMessage, e);