Class SevenZipAESEncryptionSettings

Class SevenZipAESEncryptionSettings

Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.2.0)

Base class for settings for several 7z encryption methods.

public class SevenZipAESEncryptionSettings : SevenZipEncryptionSettings

Inheritance

objectSevenZipEncryptionSettingsSevenZipAESEncryptionSettings

Inherited Members

SevenZipEncryptionSettings.Password, SevenZipEncryptionSettings.EncryptHeader, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Remarks

The AES-256 is the only possible encryption method for 7z archive. So the Aspose.Zip.Saving.SevenZipAESEncryptionSettings is the only implementation.

Constructors

SevenZipAESEncryptionSettings(string)

Initializes a new instance of the Aspose.Zip.Saving.SevenZipAESEncryptionSettings class.

public SevenZipAESEncryptionSettings(string password)

Parameters

password string

Password for encryption or decryption.

Examples

using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings("p@s$"))))
{
   archive.CreateEntry("data.bin", "data.bin");
   archive.Save("archive.7z");
}

SevenZipAESEncryptionSettings(SevenZipCipher)

Initializes a new instance of the Aspose.Zip.Saving.SevenZipAESEncryptionSettings class with external cipher.

public SevenZipAESEncryptionSettings(SevenZipCipher cipher)

Parameters

cipher SevenZipCipher

Custom AES implementation.

Examples

SevenZipCipher cipher = ComposeMyCipher();
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(null, new SevenZipAESEncryptionSettings(cipher))))
{
   archive.CreateEntry("data.bin", "data.bin");
   archive.Save("archive.7z");
}
 English