}
@Override
public Promise<Void> registerHost(final AcHost acHost) {
if (stripToNull(acHost.getPublicKey()) == null) {
throw new InvalidAuthenticationRequestException("No public key provided in registration request");
}
Promise<Void> hostRegistered = fetchPublicKeyFromRemoteHost(acHost).map(new Function<String, Void>() {
@Override
public Void apply(String fetchedPublicKey) throws Throwable {
fetchedPublicKey = stripToNull(fetchedPublicKey);