LIBRARY

libzip (-lzip)

SYNOPSIS

#include <zip.h>

struct zip_file *

zip_fopen_encrypted(struct zip *archiveconst char *fnamezip_flags_t flagsconst char *password);

struct zip_file *

zip_fopen_index_encrypted(struct zip *archivezip_uint64_t indexzip_flags_t flagsconst char *password);

DESCRIPTION

The zip_fopen_encrypted() function opens the encrypted file name fname in archive using the password given in the password argument. The flags argument are the same as for zip_fopen(3).

The zip_fopen_index_encrypted() function opens the file at position index, see zip_fopen_index(3). These functions are called automatically by zip_fopen(3); you only need to call them if you want to specify a non-default password (see zip_set_default_password(3)).

RETURN VALUES

Upon successful completion, a struct zip_file pointer is returned. Otherwise, NULL is returned and the error code in archive is set to indicate the error.

ERRORS

[ZIP_ER_NOPASSWD]

No password was provided.

The function zip_fopen_encrypted() may also fail and set zip_err for any of the errors specified for the routine zip_fopen(3).

The function zip_fopen_index_encrypted() may also fail and set zip_err for any of the errors specified for the routine zip_fopen_index(3).

RELATED TO zip_fopen_index_encrypted…

AUTHORS

Dieter Baron <[email protected]> and Thomas Klausner <[email protected]>