Class SevenZipAESEncryptionSettings
Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.1.0)
Базовий клас для налаштувань для кількох методів шифрування 7z.
public class SevenZipAESEncryptionSettings : SevenZipEncryptionSettings
Спадкування
object ← SevenZipEncryptionSettings ← SevenZipAESEncryptionSettings
Спадковані члени
SevenZipEncryptionSettings.Password, SevenZipEncryptionSettings.EncryptHeader, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Зауваження
AES-256 є єдиним можливим методом шифрування для архіву 7z. Отже, Aspose.Zip.Saving.SevenZipAESEncryptionSettings є єдиною реалізацією.
Конструктори
SevenZipAESEncryptionSettings(string)
Ініціалізує новий екземпляр класу Aspose.Zip.Saving.SevenZipAESEncryptionSettings.
public SevenZipAESEncryptionSettings(string password)
Параметри
password
string
Пароль для шифрування або дешифрування.
Приклади
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings("p@s$"))))
{
archive.CreateEntry("data.bin", "data.bin");
archive.Save("archive.7z");
}
SevenZipAESEncryptionSettings(SevenZipCipher)
Ініціалізує новий екземпляр класу Aspose.Zip.Saving.SevenZipAESEncryptionSettings з зовнішнім шифром.
public SevenZipAESEncryptionSettings(SevenZipCipher cipher)
Параметри
cipher
SevenZipCipher
Користувацька реалізація AES.
Приклади
SevenZipCipher cipher = ComposeMyCipher();
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings(cipher))))
{
archive.CreateEntry("data.bin", "data.bin");
archive.Save("archive.7z");
}