code: func KeyLength(key interface{}) int {
  	if key == nil {
  		return 0
  	}
  	if ecdsaKey, ok := key.(*ecdsa.PublicKey); ok {
  		return ecdsaKey.Curve.Params().BitSize
  	} else if rsaKey, ok := key.(*rsa.PublicKey); ok {
  		return rsaKey.N.BitLen()
  	}
  
  	return 0
  }
docs: // KeyLength returns the bit size of ECDSA or RSA PublicKey