/// <summary> /// 获得密钥数组 /// </summary> /// <returns>密钥数组</returns> private byte[] GetLegalKey() { string result = key; mCrypto.GenerateKey(); byte[] keyBytes = mCrypto.Key; int keyLength = keyBytes.Length; if (result.Length > keyLength) { result = result.Substring(0, keyLength); } else if (result.Length < keyLength) { result = result.PadRight(keyLength, ' '); } return(ASCIIEncoding.ASCII.GetBytes(result)); }
public override void GenerateKey() => _impl.GenerateKey();