public static ManagerBitLockerUnlock FromString(string str, CryptoProvider decryptor) { string[] datas = str.Split(','); byte[] password = Convert.FromBase64String(datas.Last()); byte[] decryptPassword = new byte[password.Length]; decryptor.CryptoStream.Write(password, 0, password.Length); decryptor.CryptoStream.Decrypt(decryptPassword, 0, decryptPassword.Length); return(new ManagerBitLockerUnlock(ClientDrive.FromString(str), Encoding.UTF8.GetString(decryptPassword, 0, decryptPassword.Length), decryptor)); }
public ManagerBitLockerUnlock(ClientDrive drive, string password, CryptoProvider cryptor) { Drive = drive; Password = password; this.cryptor = cryptor; }