code: func ParsePrivateKeyDER(der []byte) (crypto.Signer, error) {
  	generalKey, err := x509.ParsePKCS8PrivateKey(der)
  	if err != nil {
  		generalKey, err = x509.ParsePKCS1PrivateKey(der)
  		if err != nil {
  			generalKey, err = x509.ParseECPrivateKey(der)
  			if err != nil {
  				logrus.Errorf("Failed to parse key: %v.", err)
  				return nil, trace.BadParameter("failed parsing private key")
  			}
  		}
  	}
  
  	switch generalKey.(type) {
  	case *rsa.PrivateKey:
  		return generalKey.(*rsa.PrivateKey), nil
  	case *ecdsa.PrivateKey:
  		return generalKey.(*ecdsa.PrivateKey), nil
  	}
  
  	return nil, trace.BadParameter("unsupported private key type")
  }
docs: // ParsePrivateKeyDER parses unencrypted DER-encoded private key