class CacheKeyBuilder implements IdentifierGenerator {

    @Override
    public String buildKey(final String username, final String password, final URI serverAddress) {
        try {
            return Base64.encodeBase64String(
                    (USERNAME_PASSWORD_SALT + username + password + serverAddress.toString()).getBytes("utf-8"));
        } catch (final UnsupportedEncodingException e) {
            throw new Error(e);
        }
    }

}