Skip to content

Commit

Permalink
Fix #228: Clarify keyword arguments for encryption/decryption.
Browse files Browse the repository at this point in the history
  • Loading branch information
vsajip committed Aug 13, 2023
1 parent 7f7b32d commit 724b259
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,11 @@ extra_args (defaults to ``None``)
could pass ``extra_args=['-z', '0']`` to disable compression, or you could pass
``extra_args=['--set-filename', 'name-to-embed-in-encrypted-file.txt']`` to embed
a specific file name in the encrypted message.
armor (defaults to ``True``)
Whether to use ASCII armor. If ``False``, binary data is produced.
output (defaults to ``None``)
The name of an output file to write to. If a name is specified, the encrypted
output is written directly to the file.

.. index:: Encryption; symmetric

Expand All @@ -893,16 +898,6 @@ symmetric (defaults to ``False``)
where ``reason`` is a text description of the reason, and ``ident`` identifies the
recipient key.


The :meth:`~gnupg.GPG.encrypt_file` method takes the following additional
keyword arguments:

armor (defaults to ``True``)
Whether to use ASCII armor. If ``False``, binary data is produced.
output (defaults to ``None``)
The name of an output file to write to. If a name is specified, the encrypted
output is written directly to the file.

.. note:: Any public key provided for encryption should be trusted, otherwise
encryption fails but without any warning. This is because gpg just prints a message
to the console, but does not provide a specific error indication that the Python
Expand Down Expand Up @@ -948,6 +943,9 @@ passphrase (defaults to ``None``)
A passphrase to use when accessing the keyrings.
extra_args (defaults to ``None``)
A list of additional arguments to pass to the ``gpg`` executable.
output (defaults to ``None``)
The name of an output file to write to. If a name is specified, the decrypted
output is written directly to the file.

.. versionadded:: 0.4.1
The ``extra_args`` keyword argument was added.
Expand All @@ -956,12 +954,6 @@ extra_args (defaults to ``None``)
Upon a successful decryption, the keyid of the decrypting key is stored in the
``key_id`` attribute of the result, if this information is provided by ``gpg``.

The ``decrypt_file`` method takes the following additional keyword argument:

output (defaults to ``None``)
The name of an output file to write to. If a name is specified, the decrypted
output is written directly to the file.

.. versionchanged:: 0.5.0
The `stream` argument to :meth:`~gnupg.GPG.decrypt_file` can be a pathname
to an existing file as well as text or a file-like object. In the pathname
Expand Down

0 comments on commit 724b259

Please sign in to comment.