"The received content is not a user public key. Did not find the public key of user '{}'.",
requestingUserId);
throw new GetFailedException("Received unkown content.");
} else {
logger.trace("Successfully received the public key of user '{}'.", requestingUserId);
UserPublicKey userPublicKey = (UserPublicKey) content;
if (userPublicKey.getPublicKey() == null) {
logger.error("User public key of user '{}' is corrupted.", requestingUserId);
throw new GetFailedException("Received corrupted public key.");
} else {
logger.debug("Successfully got the public key of user '{}'.", userId);
// store it in the cache
publicKeyCache.put(requestingUserId, userPublicKey.getPublicKey());
// return it
return userPublicKey.getPublicKey();
}
}
}