code: func getKeyFromCert(certificate string) (key interface{}, err error) {
  	block, rest := pem.Decode([]byte(certificate))
  	if block == nil || block.Type != "CERTIFICATE" || len(rest) > 0 {
  		return nil, fmt.Errorf("failed to decode PEM block containing certificate")
  	}
  
  	cert, err := x509.ParseCertificate(block.Bytes)
  	if err != nil {
  		return nil, errors.Wrap(err, "PEM parse error")
  	}
  	key = cert.PublicKey
  	return
  }
docs: // getKeyFromCert returns the public key found in a X.509 certificate.