class HubEncryptionKeyStore implements EncryptionKeyStore {

    @Override
    public PublicKey getEncryptionKeyForEntity(String entityId) {
        LOG.info("Retrieving encryption key for {} from config", entityId);
        try {
            return configServiceKeyStore.getEncryptionKeyForEntity(entityId);
        } catch (ApplicationException e) {
            if (e.getExceptionType().equals(ExceptionType.CLIENT_ERROR)) {
                throw new NoKeyConfiguredForEntityException(entityId);
            }
            throw new RuntimeException(e);
        }
    }

    @Inject public  HubEncryptionKeyStore(ConfigServiceKeyStore configServiceKeyStore);

}