TraditionalEncryptionSettings

Inheritance: java.lang.Object, com.aspose.zip.EncryptionSettings

public class TraditionalEncryptionSettings extends EncryptionSettings

Settings for traditional ZipCrypto algorithm.

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

Constructors

ConstructorDescription
TraditionalEncryptionSettings(String password)Initializes a new instance of the TraditionalEncryptionSettings class.
TraditionalEncryptionSettings(String password, Charset encoding)Initializes a new instance of the TraditionalEncryptionSettings class with user defined encoding.
TraditionalEncryptionSettings()Initializes a new instance of the TraditionalEncryptionSettings class without a password.

TraditionalEncryptionSettings(String password)

public TraditionalEncryptionSettings(String password)

Initializes a new instance of the TraditionalEncryptionSettings class.


    try (Archive archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p@s$")))) {
        archive.createEntry("data.bin", "data.bin");
        archive.save(zipFile);
    }
 

Parameters:

ParameterTypeDescription
passwordjava.lang.StringPassword for encryption.

TraditionalEncryptionSettings(String password, Charset encoding)

public TraditionalEncryptionSettings(String password, Charset encoding)

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


    try (Archive archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p�s$", StandardCharsets.US_ASCII)))) {
        archive.createEntry("data.bin", "data.bin");
        archive.save(zipFile);
    }
 

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

Parameters:

ParameterTypeDescription
passwordjava.lang.StringPassword for encryption.
encodingjava.nio.charset.CharsetEncoding for password characters.

TraditionalEncryptionSettings()

public TraditionalEncryptionSettings()

Initializes a new instance of the TraditionalEncryptionSettings class without a password.