class PemKeySource implements KeySource {

  @Override
  public List<LoadedPublicKey> loadKeysFromSource() {
    try {
      LOG.info("Loading public key for token signature verification from PEM {}", pemKeyLocation);
      X509Certificate cer = loadCertificate(pemKeyLocation);
      RSAPublicKey publicKey = extractRsaPublicKey(cer);
      LOG.info("Loaded public key for token signature verification from PEM {}", pemKeyLocation);
      return Collections.singletonList(new LoadedPublicKey(kid, publicKey, this));
    } catch (IOException | CertificateException | NullPointerException | ClassCastException e) {
      throw new KeyLoadFailedException(
          "Failed to load public key for token signature verification from PEM " + pemKeyLocation,
          e);
    }
  }

  public  PemKeySource(String kid, URI pemKeyLocation);

}