Class SevenZipAESEncryptionSettings
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");
}