code: func ParsePEMCertificate(cert []byte) (*x509.Certificate, error) {
  	pemBlock, err := pemDecode(cert)
  	if pemBlock == nil {
  		return nil, err
  	}
  
  	// from a DER encoded certificate
  	return x509.ParseCertificate(pemBlock.Bytes)
  }
docs: // ParsePEMCertificate returns Certificate from a PEM encoded certificate.
  // The certificate has to be PEM encoded. Any other encodings like DER will fail.