code: public final X509Certificate retrieveCertificate(KeyStore keyStore, String certificateName) {
          try {
              logger.entry();
              X509Certificate certificate = (X509Certificate) keyStore.getCertificate(certificateName);
              logger.exit();
              return certificate;
          } catch (KeyStoreException e) {
              RuntimeException exception = new RuntimeException("An unexpected exception occurred while attempting to retrieve a certificate.", e);
              logger.error(exception.toString());
              throw exception;
          }
      }
docs: This method retrieves a public certificate from a key store.
  
  @param keyStore The key store containing the certificate.
  @param certificateName The name (alias) of the certificate.
  @return The X509 format public certificate.