class HubMetadataPublicKeyStore implements InternalPublicKeyStore {

    @Override
    public List<PublicKey> getVerifyingKeysForEntity() {
        try {
            CriteriaSet criteria = new CriteriaSet(new EntityIdCriterion(hubEntityId));
            return Optional.ofNullable(metadataResolver.resolveSingle(criteria))
                    .map(this::getPublicKeys)
                    .orElseThrow(hubMissingException());
        } catch (ResolverException e) {
            throw Throwables.propagate(e);
        }
    }

    @Inject public  HubMetadataPublicKeyStore(MetadataResolver metadataResolver,
                                     PublicKeyFactory publicKeyFactory,
                                     @Named("HubEntityId") String hubEntityId);

}