public Void apply(String fetchedPublicKey) throws Throwable {
fetchedPublicKey = stripToNull(fetchedPublicKey);
String providedPublicKey = stripToNull(acHost.getPublicKey());
boolean keysMatch = Objects.equal(fetchedPublicKey, providedPublicKey);
if (!keysMatch) {
throw new MismatchPublicKeyException(providedPublicKey, fetchedPublicKey);
}
acHostRepository.save(acHost);
return null;
}
});