code: public static X509Certificate getCertfromPEM(String certFile)
              throws IOException, CertificateException, NoSuchProviderException {
          InputStream inStrm = new FileInputStream(certFile);
          X509Certificate cert = getCertfromPEM(inStrm);
          return cert;
      }
docs: Reads a certificate in PEM-format from a file. The file may contain other
  things, the first certificate in the file is read.
  
  @param certFile
  the file containing the certificate in PEM-format
  @return X509Certificate
  @exception IOException
  if the filen cannot be read.
  @exception CertificateException
  if the filen does not contain a correct certificate.
  @throws NoSuchProviderException
  NoSuchProviderException