Class TraditionalEncryptionSettings

Class TraditionalEncryptionSettings

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

Base class for settings for several zip encryption methods.

public class TraditionalEncryptionSettings : EncryptionSettings

Inheritance

objectEncryptionSettingsTraditionalEncryptionSettings

Inherited Members

EncryptionSettings.Method, EncryptionSettings.Password, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Remarks

See section 6.0 at ZIP format description: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

Constructors

TraditionalEncryptionSettings(string)

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

public TraditionalEncryptionSettings(string password)

Parameters

password string

Password for encryption.

Examples

using (var archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p@s$"))))
{
    archive.CreateEntry("data.bin", "data.bin");
    archive.Save(zipFile);
}

TraditionalEncryptionSettings(string, Encoding)

Initializes a new instance of the Aspose.Zip.Saving.TraditionalEncryptionSettings class with user defined encoding.

public TraditionalEncryptionSettings(string password, Encoding encoding)

Parameters

password string

Password for encryption.

encoding Encoding

Encoding for password characters.

Examples

using (var archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p£s$", System.Text.Encoding.ASCII))))
{
    archive.CreateEntry("data.bin", "data.bin");
    archive.Save(zipFile);
}

Remarks

Usage of this constructor is discouraged. Setting the encoding may contradict the standard and produce incompatible archive.

TraditionalEncryptionSettings()

Initializes a new instance of the Aspose.Zip.Saving.TraditionalEncryptionSettings class without a password.

public TraditionalEncryptionSettings()
 English