ARCHIVE\_WRITE\_SET\_PASSPHRASE(3) Library Functions Manual ARCHIVE\_WRITE\_SET\_PASSPHRASE(3)

# [NAME](#NAME)

`archive_write_set_passphrase`, `archive_write_set_passphrase_callback` — functions for writing encrypted archives

# [LIBRARY](#LIBRARY)

Streaming Archive Library (libarchive, -larchive)

# [SYNOPSIS](#SYNOPSIS)

`#include <archive.h>`

`int`  
`archive_write_set_passphrase`(`struct archive *`, `const char *passphrase`);

`int`  
`archive_write_set_passphrase_callback`(`struct archive *`, `void *client_data`, `archive_passphrase_callback *`);

# [DESCRIPTION](#DESCRIPTION)

[`archive_write_set_passphrase`](#archive_write_set_passphrase)()

Set a passphrase for writing an encrypted archive. If `passphrase` is `NULL` or empty, this function will do nothing and `ARCHIVE_FAILED` will be returned. Otherwise, `ARCHIVE_OK` will be returned.

[`archive_write_set_passphrase_callback`](#archive_write_set_passphrase_callback)()

Register a callback function that will be invoked to get a passphrase for encryption if the passphrase was not set by the `archive_write_set_passphrase`() function.

# [SEE ALSO](#SEE_ALSO)

[tar(1)](/man/os/libarchive/tar.1), [archive\_write(3)](/man/os/libarchive/archive_write.3), [archive\_write\_set\_options(3)](/man/os/libarchive/archive_write_set_options.3), [libarchive(3)](/man/os/libarchive/libarchive.3)

September 21, 2014 Linux 4.19.0-gvisor

---

Document: archive_write_set_passphrase(3) from libarchive 3.8.10-r0 (Chainguard OS)
Source: https://github.com/libarchive/libarchive
