/// <summary> /// 创建签名秘钥 /// </summary> /// <param name="lenght">签名秘钥字节长度</param> /// <returns>签名Key Base64字符串</returns> public static String CreatedSignKey(int lenght = 32) { return(CryptoTransform.CreateKey(lenght)); //byte[] bytes = new Byte[lenght]; //using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider()) //{ // rng.GetBytes(bytes); // return Convert.ToBase64String(bytes); //} }
public static String CreateKeyNoIv() { return(CryptoTransform.CreateKey(32)); }