private PublicKey getPublicKey(ClientSync request) throws GeneralSecurityException { PublicKey endpointKey = null; if (request.getProfileSync() != null && request.getProfileSync().getEndpointPublicKey() != null) { byte[] publicKeySrc = request.getProfileSync().getEndpointPublicKey().array(); endpointKey = KeyUtil.getPublic(publicKeySrc); } if (endpointKey == null) { EndpointObjectHash hash = getEndpointObjectHash(request); endpointKey = cacheService.getEndpointKey(hash); } return endpointKey; }
/** * Return true if client sync information is valid or false if not. * * @return true if valid, false if not */ public boolean isValid() { ClientSyncMetaData md = this.getClientSyncMetaData(); // TODO: validate if public key hash matches hash of public key during // profile registration command. if (md.getProfileHash() == null) { ProfileClientSync profileRequest = this.getProfileSync(); if (profileRequest == null || profileRequest.getEndpointPublicKey() == null) { return false; } } return true; }
/** * Returns whether a transport a type is valid. * @param type transport type * @return true if type is valid otherwise false */ public boolean isValid(TransportType type) { switch (type) { case EVENT: return request.getEventSync() != null; case NOTIFICATION: return request.getNotificationSync() != null; case CONFIGURATION: return request.getConfigurationSync() != null; case USER: return request.getUserSync() != null; case PROFILE: return request.getProfileSync() != null; case LOGGING: return request.getLogSync() != null; default: return false; } }
LOG.trace("[{}] Application token is null for request", request); boolean hasProfileSync = other.getProfileSync() != null; if (hasProfileSync) { diff.setProfileSync(other.getProfileSync()); request.setProfileSync(other.getProfileSync()); LOG.debug("[{}] Updated profile request", channelUuid);
endpointKey, context.getRequestHash(), request); context = operationsService.syncClientProfile(context, request.getProfileSync()); context = operationsService.syncUseConfigurationRawSchema( context, request.isUseConfigurationRawSchema());