code: func parseRSAPrivateKey(data []byte) (*rsa.PrivateKey, error) {
  	var err error
  
  	// Parse the key
  	var parsedKey interface{}
  	if parsedKey, err = x509.ParsePKCS1PrivateKey(data); err != nil {
  		if parsedKey, err = x509.ParsePKCS8PrivateKey(data); err != nil {
  			return nil, err
  		}
  	}
  
  	// Test if parsed key is an RSA Private Key
  	var privKey *rsa.PrivateKey
  	var ok bool
  	if privKey, ok = parsedKey.(*rsa.PrivateKey); !ok {
  		return nil, fmt.Errorf("data doesn't contain valid RSA Private Key")
  	}
  
  	return privKey, nil
  }
docs: // parseRSAPrivateKey parses a single RSA private key from the provided data