code: func (kr *BasicKeyRequest) SigAlgo() x509.SignatureAlgorithm {
  	switch kr.Algo() {
  	case "rsa":
  		switch {
  		case kr.Size() >= 4096:
  			return x509.SHA512WithRSA
  		case kr.Size() >= 3072:
  			return x509.SHA384WithRSA
  		case kr.Size() >= 2048:
  			return x509.SHA256WithRSA
  		default:
  			return x509.SHA1WithRSA
  		}
  	case "ecdsa":
  		switch kr.Size() {
  		case curveP521:
  			return x509.ECDSAWithSHA512
  		case curveP384:
  			return x509.ECDSAWithSHA384
  		case curveP256:
  			return x509.ECDSAWithSHA256
  		default:
  			return x509.ECDSAWithSHA1
  		}
  	default:
  		return x509.UnknownSignatureAlgorithm
  	}
  }
docs: // SigAlgo returns an appropriate X.509 signature algorithm given the
  // key request's type and size.