Class SevenZipAESEncryptionSettings
Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.1.0)
Lớp cơ sở cho các thiết lập cho nhiều phương pháp mã hóa 7z.
public class SevenZipAESEncryptionSettings : SevenZipEncryptionSettings
Kế thừa
object ← SevenZipEncryptionSettings ← SevenZipAESEncryptionSettings
Các thành viên kế thừa
SevenZipEncryptionSettings.Password, SevenZipEncryptionSettings.EncryptHeader, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Ghi chú
AES-256 là phương pháp mã hóa duy nhất có thể cho tệp lưu trữ 7z. Vì vậy, Aspose.Zip.Saving.SevenZipAESEncryptionSettings là triển khai duy nhất.
Các hàm khởi tạo
SevenZipAESEncryptionSettings(string)
Khởi tạo một thể hiện mới của lớp Aspose.Zip.Saving.SevenZipAESEncryptionSettings.
public SevenZipAESEncryptionSettings(string password)
Tham số
password
string
Mật khẩu để mã hóa hoặc giải mã.
Ví dụ
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings("p@s$"))))
{
archive.CreateEntry("data.bin", "data.bin");
archive.Save("archive.7z");
}
SevenZipAESEncryptionSettings(SevenZipCipher)
Khởi tạo một thể hiện mới của lớp Aspose.Zip.Saving.SevenZipAESEncryptionSettings với cipher bên ngoài.
public SevenZipAESEncryptionSettings(SevenZipCipher cipher)
Tham số
cipher
SevenZipCipher
Triển khai AES tùy chỉnh.
Ví dụ
SevenZipCipher cipher = ComposeMyCipher();
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings(cipher))))
{
archive.CreateEntry("data.bin", "data.bin");
archive.Save("archive.7z");
}