Merge branch 'ben/docs/2018-03' of ssh+git://playfair.gnupg.org/git/gpgme into ben/docs/2018-03
This commit is contained in:
commit
76055dd5c7
1
.gitignore
vendored
1
.gitignore
vendored
@ -52,4 +52,3 @@ nosetests.xml
|
|||||||
default.profraw
|
default.profraw
|
||||||
.DS_Store
|
.DS_Store
|
||||||
._.DS_Store
|
._.DS_Store
|
||||||
default.profraw
|
|
157
TODO
157
TODO
@ -14,23 +14,46 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
tracked through the [[https://dev.gnupg.org/][dev.gnupg.org]] site.
|
tracked through the [[https://dev.gnupg.org/][dev.gnupg.org]] site.
|
||||||
|
|
||||||
|
|
||||||
* TODO Document all the new stuff.
|
* Documentation
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: more-docs-is-better
|
:CUSTOM_ID: documentation
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** STARTED Fix this TODO list.
|
** Document all the new stuff.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: fix-todo
|
:CUSTOM_ID: more-docs-is-better
|
||||||
:END:
|
:END:
|
||||||
- State "STARTED" from "TODO" [2018-03-09 Fri 08:31]
|
|
||||||
Clean up the current TODO list. Include properties as relevant (so
|
|
||||||
if someone does make a PDF or HTML version the TOC will work).
|
|
||||||
|
|
||||||
Also check ans see if some of these ancient things can be removed
|
*** TODO Fix this TODO list.
|
||||||
(e.g. do we really need to fix things that were broken in GPG
|
:PROPERTIES:
|
||||||
1.3.x? I'm thinking not so much).
|
:CUSTOM_ID: fix-todo
|
||||||
|
:END:
|
||||||
|
|
||||||
|
Clean up the current TODO list. Include properties as relevant (so
|
||||||
|
if someone does make a PDF or HTML version the TOC will work).
|
||||||
|
|
||||||
|
Also check ans see if some of these ancient things can be removed
|
||||||
|
(e.g. do we really need to fix things that were broken in GPG
|
||||||
|
1.3.x? I'm thinking not so much).
|
||||||
|
|
||||||
|
**** DONE fix TODO items
|
||||||
|
CLOSED: [2018-03-04 Sun 08:55]
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: fix-todo-items
|
||||||
|
:END:
|
||||||
|
|
||||||
|
Adjust todo items so each can now be referenced by custom-id and
|
||||||
|
checked off as necessary.
|
||||||
|
|
||||||
|
** TODO Document validity and trust issues.
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: valid-trust-issues
|
||||||
|
:END:
|
||||||
|
|
||||||
|
** In gpgme.texi: Register callbacks under the right letter in the index.
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: gpgme-texi
|
||||||
|
:END:
|
||||||
|
|
||||||
|
|
||||||
* Fix the remaining UI Server problems:
|
* Fix the remaining UI Server problems:
|
||||||
@ -63,10 +86,12 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:END:
|
:END:
|
||||||
Right now we block reading the next line with assuan.
|
Right now we block reading the next line with assuan.
|
||||||
|
|
||||||
|
|
||||||
* Before release:
|
* Before release:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: pre-release
|
:CUSTOM_ID: pre-release
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** CANCELLED Some gpg tests fail with gpg 1.3.4-cvs (gpg/t-keylist-sig)
|
** CANCELLED Some gpg tests fail with gpg 1.3.4-cvs (gpg/t-keylist-sig)
|
||||||
CLOSED: [2018-03-09 Fri 08:16]
|
CLOSED: [2018-03-09 Fri 08:16]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -75,100 +100,123 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
- State "CANCELLED" from "TODO" [2018-03-09 Fri 08:16] \\
|
- State "CANCELLED" from "TODO" [2018-03-09 Fri 08:16] \\
|
||||||
WON'T FIX — too old or no longer applies.
|
WON'T FIX — too old or no longer applies.
|
||||||
The test is currently disabled there and in gpg/t-import.
|
The test is currently disabled there and in gpg/t-import.
|
||||||
|
|
||||||
** When gpg supports it, write binary subpackets directly,
|
** When gpg supports it, write binary subpackets directly,
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: binary-subpackets
|
:CUSTOM_ID: binary-subpackets
|
||||||
:END:
|
:END:
|
||||||
and parse SUBPACKET status lines.
|
and parse SUBPACKET status lines.
|
||||||
|
|
||||||
|
|
||||||
* ABI's to break:
|
* ABI's to break:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: abi-breakage-apparently-on-purpose
|
:CUSTOM_ID: abi-breakage-apparently-on-purpose
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Old opassuan interface.
|
** Old opassuan interface.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: old-opassuan
|
:CUSTOM_ID: old-opassuan
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Implementation: Remove support for old style error codes in
|
** Implementation: Remove support for old style error codes in
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: remove-old-error-codes
|
:CUSTOM_ID: remove-old-error-codes
|
||||||
:END:
|
:END:
|
||||||
conversion.c::_gpgme_map_gnupg_error.
|
conversion.c::_gpgme_map_gnupg_error.
|
||||||
|
|
||||||
** gpgme_edit_cb_t: Add "processed" return argument
|
** gpgme_edit_cb_t: Add "processed" return argument
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: add-processed-return
|
:CUSTOM_ID: add-processed-return
|
||||||
:END:
|
:END:
|
||||||
(see edit.c::command_handler).
|
(see edit.c::command_handler).
|
||||||
|
|
||||||
** I/O and User Data could be made extensible. But this can be done
|
** I/O and User Data could be made extensible. But this can be done
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: add-io-user-data
|
:CUSTOM_ID: add-io-user-data
|
||||||
:END:
|
:END:
|
||||||
without breaking the ABI hopefully.
|
without breaking the ABI hopefully.
|
||||||
|
|
||||||
** All enums should be replaced by ints and simple macros for
|
** All enums should be replaced by ints and simple macros for
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: enums-should-be-ints
|
:CUSTOM_ID: enums-should-be-ints
|
||||||
:END:
|
:END:
|
||||||
maximum compatibility.
|
maximum compatibility.
|
||||||
|
|
||||||
** Compatibility interfaces that can be removed in future versions:
|
** Compatibility interfaces that can be removed in future versions:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: compat-interfaces-to-go
|
:CUSTOM_ID: compat-interfaces-to-go
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_data_new_from_filepart
|
*** gpgme_data_new_from_filepart
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-data-new-from-filepart
|
:CUSTOM_ID: gpgme-data-new-from-filepart
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_data_new_from_file
|
*** gpgme_data_new_from_file
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-data-new-from-file
|
:CUSTOM_ID: gpgme-data-new-from-file
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_data_new_with_read_cb
|
*** gpgme_data_new_with_read_cb
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-data-new-with-read-cb
|
:CUSTOM_ID: gpgme-data-new-with-read-cb
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_data_rewind
|
*** gpgme_data_rewind
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-data-rewind
|
:CUSTOM_ID: gpgme-data-rewind
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_op_import_ext
|
*** gpgme_op_import_ext
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-op-import-ext
|
:CUSTOM_ID: gpgme-op-import-ext
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_get_sig_key
|
*** gpgme_get_sig_key
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-get-sig-key
|
:CUSTOM_ID: gpgme-get-sig-key
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_get_sig_ulong_attr
|
*** gpgme_get_sig_ulong_attr
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-get-sig-ulong-attr
|
:CUSTOM_ID: gpgme-get-sig-ulong-attr
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_get_sig_string_attr
|
*** gpgme_get_sig_string_attr
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-get-sig-string-attr
|
:CUSTOM_ID: gpgme-get-sig-string-attr
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** GPGME_SIG_STAT_*
|
*** GPGME_SIG_STAT_*
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-sig-stat
|
:CUSTOM_ID: gpgme-sig-stat
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_get_sig_status
|
*** gpgme_get_sig_status
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-get-sig-status
|
:CUSTOM_ID: gpgme-get-sig-status
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_trust_item_release
|
*** gpgme_trust_item_release
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-trust-item-release
|
:CUSTOM_ID: gpgme-trust-item-release
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_trust_item_get_string_attr
|
*** gpgme_trust_item_get_string_attr
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-trust-item-get-string-attr
|
:CUSTOM_ID: gpgme-trust-item-get-string-attr
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_trust_item_get_ulong_attr
|
*** gpgme_trust_item_get_ulong_attr
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-trust-item-get-ulong-attr
|
:CUSTOM_ID: gpgme-trust-item-get-ulong-attr
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** gpgme_attr_t
|
*** gpgme_attr_t
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgme-attr-t
|
:CUSTOM_ID: gpgme-attr-t
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** All Gpgme* typedefs.
|
*** All Gpgme* typedefs.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: all-gpgme-typedefs
|
:CUSTOM_ID: all-gpgme-typedefs
|
||||||
@ -179,20 +227,24 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: threads
|
:CUSTOM_ID: threads
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** When GNU Pth supports sendmsg/recvmsg, wrap them properly.
|
** When GNU Pth supports sendmsg/recvmsg, wrap them properly.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: wrap-oth
|
:CUSTOM_ID: wrap-oth
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Without timegm (3) support our ISO time parser is not thread safe.
|
** Without timegm (3) support our ISO time parser is not thread safe.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: time-threads
|
:CUSTOM_ID: time-threads
|
||||||
:END:
|
:END:
|
||||||
There is a configure time warning, though.
|
There is a configure time warning, though.
|
||||||
|
|
||||||
|
|
||||||
* New features:
|
* New features:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: new-features
|
:CUSTOM_ID: new-features
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Flow control for data objects.
|
** Flow control for data objects.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: flow-control-is-not-a-euphemism-for-an-s-bend
|
:CUSTOM_ID: flow-control-is-not-a-euphemism-for-an-s-bend
|
||||||
@ -205,11 +257,13 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
respective event loop. or (B) a way for gpgme data objects to be
|
respective event loop. or (B) a way for gpgme data objects to be
|
||||||
associated with a waitable object, that can be registered with the
|
associated with a waitable object, that can be registered with the
|
||||||
user event loop. Neither is particularly simple.
|
user event loop. Neither is particularly simple.
|
||||||
|
|
||||||
** Extended notation support. When gpg supports arbitrary binary
|
** Extended notation support. When gpg supports arbitrary binary
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: extended-notation
|
:CUSTOM_ID: extended-notation
|
||||||
:END:
|
:END:
|
||||||
notation data, provide a user interface for that.
|
notation data, provide a user interface for that.
|
||||||
|
|
||||||
** notification system
|
** notification system
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: notification-system
|
:CUSTOM_ID: notification-system
|
||||||
@ -236,25 +290,30 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: stat-data
|
:CUSTOM_ID: stat-data
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Implement support for photo ids.
|
** Implement support for photo ids.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: photo-id
|
:CUSTOM_ID: photo-id
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Allow selection of subkeys
|
** Allow selection of subkeys
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: subkey-selection
|
:CUSTOM_ID: subkey-selection
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Allow to return time stamps in ISO format
|
** Allow to return time stamps in ISO format
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: iso-format-datetime
|
:CUSTOM_ID: iso-format-datetime
|
||||||
:END:
|
:END:
|
||||||
This allows us to handle years later than 2037 properly. With the
|
This allows us to handle years later than 2037 properly. With the
|
||||||
time_t interface they are all mapped to 2037-12-31
|
time_t interface they are all mapped to 2037-12-31
|
||||||
|
|
||||||
** New features requested by our dear users, but rejected or left for
|
** New features requested by our dear users, but rejected or left for
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: feature-requests
|
:CUSTOM_ID: feature-requests
|
||||||
:END:
|
:END:
|
||||||
later consideration:
|
later consideration:
|
||||||
|
|
||||||
*** Allow to export secret keys.
|
*** Allow to export secret keys.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: export-secret-keys
|
:CUSTOM_ID: export-secret-keys
|
||||||
@ -262,6 +321,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
Rejected because this is conceptually flawed. Secret keys on a
|
Rejected because this is conceptually flawed. Secret keys on a
|
||||||
smart card can not be exported, for example.
|
smart card can not be exported, for example.
|
||||||
May eventually e supproted with a keywrapping system.
|
May eventually e supproted with a keywrapping system.
|
||||||
|
|
||||||
*** Selecting the key ring, setting the version or comment in output.
|
*** Selecting the key ring, setting the version or comment in output.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: select-keyring-version
|
:CUSTOM_ID: select-keyring-version
|
||||||
@ -269,46 +329,23 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
Rejected because the naive implementation is engine specific, the
|
Rejected because the naive implementation is engine specific, the
|
||||||
configuration is part of the engine's configuration or readily
|
configuration is part of the engine's configuration or readily
|
||||||
worked around in a different way
|
worked around in a different way
|
||||||
|
|
||||||
*** Selecting the symmetric cipher.
|
*** Selecting the symmetric cipher.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: symmetric-cipher-selection
|
:CUSTOM_ID: symmetric-cipher-selection
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** Exchanging keys with key servers.
|
*** Exchanging keys with key servers.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: key-server-exchange
|
:CUSTOM_ID: key-server-exchange
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
|
|
||||||
* Documentation
|
|
||||||
:PROPERTIES:
|
|
||||||
:CUSTOM_ID: documentation
|
|
||||||
:END:
|
|
||||||
** TODO Document validity and trust issues.
|
|
||||||
:PROPERTIES:
|
|
||||||
:CUSTOM_ID: valid-trust-issues
|
|
||||||
:END:
|
|
||||||
** In gpgme.texi: Register callbacks under the right letter in the index.
|
|
||||||
:PROPERTIES:
|
|
||||||
:CUSTOM_ID: gpgme-texi
|
|
||||||
:END:
|
|
||||||
** TODO Update TODO file
|
|
||||||
:PROPERTIES:
|
|
||||||
:CUSTOM_ID: todo-update
|
|
||||||
:END:
|
|
||||||
|
|
||||||
*** DONE fix TODO items
|
|
||||||
CLOSED: [2018-03-04 Sun 08:55]
|
|
||||||
:PROPERTIES:
|
|
||||||
:CUSTOM_ID: fix-todo-items
|
|
||||||
:END:
|
|
||||||
|
|
||||||
Adjust todo items so each can now be referenced by custom-id and
|
|
||||||
checked off as necessary.
|
|
||||||
|
|
||||||
* Engines
|
* Engines
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: engines
|
:CUSTOM_ID: engines
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Do not create/destroy engines, but create engine and then reset it.
|
** Do not create/destroy engines, but create engine and then reset it.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: reset-engine-is-not-quite-just-ignition
|
:CUSTOM_ID: reset-engine-is-not-quite-just-ignition
|
||||||
@ -321,26 +358,31 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
Note that we need support in gpgsm to set include-certs to default
|
Note that we need support in gpgsm to set include-certs to default
|
||||||
as RESET does not reset it, also for no_encrypt_to and probably
|
as RESET does not reset it, also for no_encrypt_to and probably
|
||||||
other options.
|
other options.
|
||||||
|
|
||||||
** Optimize the case where a data object has an underlying fd we can pass
|
** Optimize the case where a data object has an underlying fd we can pass
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: optimus-data-cousin-of-optimus-prime
|
:CUSTOM_ID: optimus-data-cousin-of-optimus-prime
|
||||||
:END:
|
:END:
|
||||||
directly to the engine. This will be automatic with socket I/O and
|
directly to the engine. This will be automatic with socket I/O and
|
||||||
descriptor passing.
|
descriptor passing.
|
||||||
|
|
||||||
** Move code common to all engines up from gpg to engine.
|
** Move code common to all engines up from gpg to engine.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: move-code-common-to-engines-out-of-gpg
|
:CUSTOM_ID: move-code-common-to-engines-out-of-gpg
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** engine operations can return General Error on unknown protocol
|
** engine operations can return General Error on unknown protocol
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: general-error-looking-to-be-court-martialled
|
:CUSTOM_ID: general-error-looking-to-be-court-martialled
|
||||||
:END:
|
:END:
|
||||||
(it's an internal error, as select_protocol checks already).
|
(it's an internal error, as select_protocol checks already).
|
||||||
|
|
||||||
** When server mode is implemented properly, more care has to be taken to
|
** When server mode is implemented properly, more care has to be taken to
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: server-mode
|
:CUSTOM_ID: server-mode
|
||||||
:END:
|
:END:
|
||||||
release all resources on error (for example to free assuan_cmd).
|
release all resources on error (for example to free assuan_cmd).
|
||||||
|
|
||||||
** op_import_keys and op_export_keys have a limit in the number of keys.
|
** op_import_keys and op_export_keys have a limit in the number of keys.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: import-export-problems
|
:CUSTOM_ID: import-export-problems
|
||||||
@ -354,6 +396,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpg-breakage
|
:CUSTOM_ID: gpg-breakage
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** CANCELLED gpg 1.4.2 lacks error reporting if sign/encrypt with revoked key.
|
** CANCELLED gpg 1.4.2 lacks error reporting if sign/encrypt with revoked key.
|
||||||
CLOSED: [2018-03-09 Fri 08:19]
|
CLOSED: [2018-03-09 Fri 08:19]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -361,6 +404,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:END:
|
:END:
|
||||||
- State "CANCELLED" from "TODO" [2018-03-09 Fri 08:19] \\
|
- State "CANCELLED" from "TODO" [2018-03-09 Fri 08:19] \\
|
||||||
WON'T FIX.
|
WON'T FIX.
|
||||||
|
|
||||||
** CANCELLED gpg 1.4.2 does crappy error reporting (namely none at all) when
|
** CANCELLED gpg 1.4.2 does crappy error reporting (namely none at all) when
|
||||||
CLOSED: [2018-03-09 Fri 08:20]
|
CLOSED: [2018-03-09 Fri 08:20]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -374,6 +418,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
gpg: signing failed: general error
|
gpg: signing failed: general error
|
||||||
[GNUPG:] BEGIN_ENCRYPTION 2 10
|
[GNUPG:] BEGIN_ENCRYPTION 2 10
|
||||||
gpg: test: sign+encrypt failed: general error
|
gpg: test: sign+encrypt failed: general error
|
||||||
|
|
||||||
** DONE Without agent and with wrong passphrase, gpg 1.4.2 enters into an
|
** DONE Without agent and with wrong passphrase, gpg 1.4.2 enters into an
|
||||||
CLOSED: [2018-03-09 Fri 08:20]
|
CLOSED: [2018-03-09 Fri 08:20]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -382,6 +427,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
- State "DONE" from "TODO" [2018-03-09 Fri 08:20] \\
|
- State "DONE" from "TODO" [2018-03-09 Fri 08:20] \\
|
||||||
Must have been fixed in a subsequent release.
|
Must have been fixed in a subsequent release.
|
||||||
infinite loop.
|
infinite loop.
|
||||||
|
|
||||||
** CANCELLED Use correct argv[0]
|
** CANCELLED Use correct argv[0]
|
||||||
CLOSED: [2018-03-09 Fri 08:24]
|
CLOSED: [2018-03-09 Fri 08:24]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -402,71 +448,86 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: operations-are-not-surgical
|
:CUSTOM_ID: operations-are-not-surgical
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Include cert values -2, -1, 0 and 1 should be defined as macros.
|
** Include cert values -2, -1, 0 and 1 should be defined as macros.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: certified-macros
|
:CUSTOM_ID: certified-macros
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** If an operation failed, make sure that the result functions don't return
|
** If an operation failed, make sure that the result functions don't return
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: operation-failure
|
:CUSTOM_ID: operation-failure
|
||||||
:END:
|
:END:
|
||||||
corrupt partial information. !!!
|
corrupt partial information. !!!
|
||||||
NOTE: The EOF status handler is not called in this case !!!
|
NOTE: The EOF status handler is not called in this case !!!
|
||||||
|
|
||||||
** Verify must not fail on NODATA premature if auto-key-retrieval failed.
|
** Verify must not fail on NODATA premature if auto-key-retrieval failed.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: autobot-key-retrieval
|
:CUSTOM_ID: autobot-key-retrieval
|
||||||
:END:
|
:END:
|
||||||
It should not fail silently if it knows there is an error. !!!
|
It should not fail silently if it knows there is an error. !!!
|
||||||
|
|
||||||
** All operations: Better error reporting. !!
|
** All operations: Better error reporting. !!
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: better-reporting-not-like-fox-news
|
:CUSTOM_ID: better-reporting-not-like-fox-news
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Export status handler need much more work. !!!
|
** Export status handler need much more work. !!!
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: export-status-handler
|
:CUSTOM_ID: export-status-handler
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Import should return a useful error when one happened.
|
** Import should return a useful error when one happened.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: import-useful-stuff-even-wrong-stuff
|
:CUSTOM_ID: import-useful-stuff-even-wrong-stuff
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** Import does not take notice of NODATA status report.
|
*** Import does not take notice of NODATA status report.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: import-no-data
|
:CUSTOM_ID: import-no-data
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** When GPGSM does issue IMPORT_OK status reports, make sure to check for
|
*** When GPGSM does issue IMPORT_OK status reports, make sure to check for
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgsm-import-ok
|
:CUSTOM_ID: gpgsm-import-ok
|
||||||
:END:
|
:END:
|
||||||
them in tests/gpgs m/t-import.c.
|
them in tests/gpgs m/t-import.c.
|
||||||
|
|
||||||
** Verify can include info about version/algo/class, but currently
|
** Verify can include info about version/algo/class, but currently
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: verify-class
|
:CUSTOM_ID: verify-class
|
||||||
:END:
|
:END:
|
||||||
this is only available for gpg, not gpgsm.
|
this is only available for gpg, not gpgsm.
|
||||||
|
|
||||||
** Return ENC_TO output in verify result. Again, this is not available
|
** Return ENC_TO output in verify result. Again, this is not available
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: return-to-enc
|
:CUSTOM_ID: return-to-enc
|
||||||
:END:
|
:END:
|
||||||
for gpgsm.
|
for gpgsm.
|
||||||
|
|
||||||
** Genkey should return something more useful than General_Error.
|
** Genkey should return something more useful than General_Error.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: general-key-assumed-command-from-general-error
|
:CUSTOM_ID: general-key-assumed-command-from-general-error
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** If possible, use --file-setsize to set the file size for proper progress
|
** If possible, use --file-setsize to set the file size for proper progress
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: file-setsize
|
:CUSTOM_ID: file-setsize
|
||||||
:END:
|
:END:
|
||||||
callback handling. Write data interface for file size.
|
callback handling. Write data interface for file size.
|
||||||
|
|
||||||
** Optimize the file descriptor list, so the number of open fds is
|
** Optimize the file descriptor list, so the number of open fds is
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: optimus-descriptus-younger-brother-of-optimus-prime
|
:CUSTOM_ID: optimus-descriptus-younger-brother-of-optimus-prime
|
||||||
:END:
|
:END:
|
||||||
always known easily.
|
always known easily.
|
||||||
|
|
||||||
** Encryption: It should be verified that the behaviour for partially untrusted
|
** Encryption: It should be verified that the behaviour for partially untrusted
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: only-mostly-dead-means-partially-alive
|
:CUSTOM_ID: only-mostly-dead-means-partially-alive
|
||||||
:END:
|
:END:
|
||||||
recipients is correct.
|
recipients is correct.
|
||||||
|
|
||||||
** When GPG issues INV_something for invalid signers, catch them.
|
** When GPG issues INV_something for invalid signers, catch them.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: invalid-sig
|
:CUSTOM_ID: invalid-sig
|
||||||
@ -477,15 +538,18 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: error-value
|
:CUSTOM_ID: error-value
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Map ASSUAN/GpgSM ERR error values in a better way than is done now. !!
|
** Map ASSUAN/GpgSM ERR error values in a better way than is done now. !!
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: map-ass-error
|
:CUSTOM_ID: map-ass-error
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Some error values should identify the source more correctly (mostly error
|
** Some error values should identify the source more correctly (mostly error
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: source-errors
|
:CUSTOM_ID: source-errors
|
||||||
:END:
|
:END:
|
||||||
values derived from status messages).
|
values derived from status messages).
|
||||||
|
|
||||||
** In rungpg.c we need to check the version of the engine
|
** In rungpg.c we need to check the version of the engine
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: rungpg-c-engine-ver
|
:CUSTOM_ID: rungpg-c-engine-ver
|
||||||
@ -498,6 +562,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: tests
|
:CUSTOM_ID: tests
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** TODO Write a fake gpg-agent so that we can supply known passphrases to
|
** TODO Write a fake gpg-agent so that we can supply known passphrases to
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: test-fake-gpg-agent
|
:CUSTOM_ID: test-fake-gpg-agent
|
||||||
@ -505,23 +570,28 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
gpgsm and setup the configuration files to use the agent. Without
|
gpgsm and setup the configuration files to use the agent. Without
|
||||||
this we are testing a currently running gpg-agent which is not a
|
this we are testing a currently running gpg-agent which is not a
|
||||||
clever idea. !
|
clever idea. !
|
||||||
|
|
||||||
** t-data
|
** t-data
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: test-data
|
:CUSTOM_ID: test-data
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** Test gpgme_data_release_and_get_mem.
|
*** Test gpgme_data_release_and_get_mem.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: test-gpgme-data-release-mem
|
:CUSTOM_ID: test-gpgme-data-release-mem
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
*** Test gpgme_data_seek for invalid types.
|
*** Test gpgme_data_seek for invalid types.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: test-gpgme-data-seek
|
:CUSTOM_ID: test-gpgme-data-seek
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** t-keylist
|
** t-keylist
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: test-keylist
|
:CUSTOM_ID: test-keylist
|
||||||
:END:
|
:END:
|
||||||
Write a test for ext_keylist.
|
Write a test for ext_keylist.
|
||||||
|
|
||||||
** Test reading key signatures.
|
** Test reading key signatures.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: test-key-sig
|
:CUSTOM_ID: test-key-sig
|
||||||
@ -532,6 +602,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: debug
|
:CUSTOM_ID: debug
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** Tracepoints should be added at: Every public interface enter/leave,
|
** Tracepoints should be added at: Every public interface enter/leave,
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: tracepoint-pub-int
|
:CUSTOM_ID: tracepoint-pub-int
|
||||||
@ -547,6 +618,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
decrypt-verify.c delete.c edit.c encrypt.c encrypt-sign.c export.c
|
decrypt-verify.c delete.c edit.c encrypt.c encrypt-sign.c export.c
|
||||||
genkey.c import.c key.c keylist.c passphrase.c progress.c signers.c
|
genkey.c import.c key.c keylist.c passphrase.c progress.c signers.c
|
||||||
sig-notation.c trust-item.c trustlist.c verify.c
|
sig-notation.c trust-item.c trustlist.c verify.c
|
||||||
|
|
||||||
** TODO Handle malloc and vasprintf errors. But decide first if they should be
|
** TODO Handle malloc and vasprintf errors. But decide first if they should be
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: malloc-vasprintf
|
:CUSTOM_ID: malloc-vasprintf
|
||||||
@ -559,10 +631,12 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: build-suite
|
:CUSTOM_ID: build-suite
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** TODO Make sure everything is cleaned correctly (esp. test area).
|
** TODO Make sure everything is cleaned correctly (esp. test area).
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: clean-tests
|
:CUSTOM_ID: clean-tests
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** TODO Enable AC_CONFIG_MACRO_DIR and bump up autoconf version requirement.
|
** TODO Enable AC_CONFIG_MACRO_DIR and bump up autoconf version requirement.
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: autoconf-macros
|
:CUSTOM_ID: autoconf-macros
|
||||||
@ -575,6 +649,7 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: error-checking
|
:CUSTOM_ID: error-checking
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
** TODO engine-gpgsm, with-validation
|
** TODO engine-gpgsm, with-validation
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: gpgsm-validation
|
:CUSTOM_ID: gpgsm-validation
|
||||||
@ -615,7 +690,11 @@ Hey Emacs, this is -*- org -*- mode!
|
|||||||
Write a guide/best practices for maintainers of GPGME packages with
|
Write a guide/best practices for maintainers of GPGME packages with
|
||||||
third party package management systems.
|
third party package management systems.
|
||||||
|
|
||||||
Copyright 2004, 2005, 2018 g10 Code GmbH
|
|
||||||
|
* Copyright 2004, 2005, 2018 g10 Code GmbH
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: copyright-and-license
|
||||||
|
:END:
|
||||||
|
|
||||||
This file is free software; as a special exception the author gives
|
This file is free software; as a special exception the author gives
|
||||||
unlimited permission to copy and/or distribute it, with or without
|
unlimited permission to copy and/or distribute it, with or without
|
||||||
|
1370
lang/python/docs/GPGMEpythonHOWTOen.org
Normal file
1370
lang/python/docs/GPGMEpythonHOWTOen.org
Normal file
File diff suppressed because it is too large
Load Diff
@ -28,13 +28,74 @@
|
|||||||
to produce reST versions via Pandoc and DITA XML can be reached
|
to produce reST versions via Pandoc and DITA XML can be reached
|
||||||
through converting to either Markdown or XHTML first.
|
through converting to either Markdown or XHTML first.
|
||||||
|
|
||||||
** TODO Documentation HOWTO
|
|
||||||
|
** STARTED Documentation HOWTO
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: todo-docs-howto
|
:CUSTOM_ID: todo-docs-howto
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
|
- State "STARTED" from "TODO" [2018-03-08 Thu 13:59] \\
|
||||||
|
Started yesterday.
|
||||||
Write a HOWTO style guide for the current Python bindings.
|
Write a HOWTO style guide for the current Python bindings.
|
||||||
|
|
||||||
|
*** DONE Start python bindings HOWTO
|
||||||
|
CLOSED: [2018-03-07 Wed 18:14]
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: howto-start
|
||||||
|
:END:
|
||||||
|
|
||||||
|
|
||||||
|
*** STARTED Include certain specific instructions in the HOWTO
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: howto-requests
|
||||||
|
:END:
|
||||||
|
|
||||||
|
Note: moved the S/MIME bits out to their own section of the TODO
|
||||||
|
list and may be served better by separate HOWTO documentation
|
||||||
|
anyway.
|
||||||
|
|
||||||
|
- State "STARTED" from "TODO" [2018-03-09 Fri 15:27]
|
||||||
|
Some functions can be worked out from the handful of examples
|
||||||
|
available, but many more can't and I've already begun receiving
|
||||||
|
requests for certain functions to be explained.
|
||||||
|
|
||||||
|
|
||||||
|
**** DONE Standard scenarios
|
||||||
|
CLOSED: [2018-03-19 Mon 12:34]
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: howto-the-basics
|
||||||
|
:END:
|
||||||
|
|
||||||
|
- State "DONE" from "STARTED" [2018-03-19 Mon 12:34] \\
|
||||||
|
All four of those are done.
|
||||||
|
- State "STARTED" from "TODO" [2018-03-09 Fri 15:26] \\
|
||||||
|
Began with the example code, now to add the text.
|
||||||
|
What everyone expects: encryption, decryption, signing and verifying.
|
||||||
|
|
||||||
|
|
||||||
|
**** STARTED Key control
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: howto-key-control
|
||||||
|
:END:
|
||||||
|
|
||||||
|
- State "STARTED" from "TODO" [2018-03-19 Mon 12:35] \\
|
||||||
|
Generating keys and subkeys are done, but revocation is still to be done.
|
||||||
|
Generating keys, adding subkeys, revoking subkeys (and keeping
|
||||||
|
the cert key), adding and revoking UIDs, signing/certifying keys.
|
||||||
|
|
||||||
|
|
||||||
|
**** DONE More key control
|
||||||
|
CLOSED: [2018-03-19 Mon 12:36]
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: howto-key-selection
|
||||||
|
:END:
|
||||||
|
|
||||||
|
- State "DONE" from "TODO" [2018-03-19 Mon 12:36] \\
|
||||||
|
Key selection, searching, matching and counting is done.
|
||||||
|
Selecting keys to encrypt to or manipulate in other ways (e.g. as
|
||||||
|
with key control or the basics).
|
||||||
|
|
||||||
|
|
||||||
** TODO Documentation SWIG
|
** TODO Documentation SWIG
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: todo-docs-swig
|
:CUSTOM_ID: todo-docs-swig
|
||||||
@ -47,6 +108,7 @@
|
|||||||
something to be used in conjunction with the existing GPGME
|
something to be used in conjunction with the existing GPGME
|
||||||
documentation which makes it easier for Python developers to use.
|
documentation which makes it easier for Python developers to use.
|
||||||
|
|
||||||
|
|
||||||
** TODO GUI examples
|
** TODO GUI examples
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: todo-gui-examples
|
:CUSTOM_ID: todo-gui-examples
|
||||||
@ -56,6 +118,7 @@
|
|||||||
to either match or be similar to the old GTK2 examples available
|
to either match or be similar to the old GTK2 examples available
|
||||||
with PyME.
|
with PyME.
|
||||||
|
|
||||||
|
|
||||||
** TODO Replace SWIG
|
** TODO Replace SWIG
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: todo-replace-swig
|
:CUSTOM_ID: todo-replace-swig
|
||||||
@ -71,6 +134,7 @@
|
|||||||
bindings using a more suitable means of interfacing with the GPGME
|
bindings using a more suitable means of interfacing with the GPGME
|
||||||
C source code.
|
C source code.
|
||||||
|
|
||||||
|
|
||||||
*** TODO Replacement for SWIG
|
*** TODO Replacement for SWIG
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: todo-replace-swig-replacement
|
:CUSTOM_ID: todo-replace-swig-replacement
|
||||||
@ -80,6 +144,7 @@
|
|||||||
the most viable candidate, but some additional testing and checks
|
the most viable candidate, but some additional testing and checks
|
||||||
are yet to be completed.
|
are yet to be completed.
|
||||||
|
|
||||||
|
|
||||||
** TODO API for an API
|
** TODO API for an API
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: todo-api-squared
|
:CUSTOM_ID: todo-api-squared
|
||||||
@ -94,6 +159,16 @@
|
|||||||
available or for which it is too difficult to create proper
|
available or for which it is too difficult to create proper
|
||||||
bindings.
|
bindings.
|
||||||
|
|
||||||
|
|
||||||
|
** TODO S/MIME
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: s-mime
|
||||||
|
:END:
|
||||||
|
|
||||||
|
Eventually add some of this, but the OpenPGP details are far more
|
||||||
|
important at the moment.
|
||||||
|
|
||||||
|
|
||||||
* Project Task Details
|
* Project Task Details
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: detailed-tasks
|
:CUSTOM_ID: detailed-tasks
|
||||||
|
58
lang/python/examples/howto/README.org
Normal file
58
lang/python/examples/howto/README.org
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#+TITLE: GPGME Python Bindings HOWTO Examples
|
||||||
|
#+LATEX_COMPILER: xelatex
|
||||||
|
#+LATEX_CLASS: article
|
||||||
|
#+LATEX_CLASS_OPTIONS: [12pt]
|
||||||
|
#+LATEX_HEADER: \usepackage{xltxtra}
|
||||||
|
#+LATEX_HEADER: \usepackage[margin=1in]{geometry}
|
||||||
|
#+LATEX_HEADER: \setmainfont[Ligatures={Common}]{Times New Roman}
|
||||||
|
#+LATEX_HEADER: \author{Ben McGinnes <ben@gnupg.org>}
|
||||||
|
|
||||||
|
|
||||||
|
* Examples
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: gpgme-python3-examples
|
||||||
|
:END:
|
||||||
|
|
||||||
|
The contents of this directory are the examples included in the /GNU
|
||||||
|
Privacy Guard (GnuPG) Made Easy Python Bindings HOWTO/ file. Each
|
||||||
|
script is explicitly for Python 3 and specifically for Python 3.4 or
|
||||||
|
later.
|
||||||
|
|
||||||
|
Some of these scripts may work with Python 2.7, but there are no
|
||||||
|
guarantees. They will include the relevant imports from the
|
||||||
|
=__future__= module to facilitate that if possible.
|
||||||
|
|
||||||
|
|
||||||
|
* Copyright and Licensing
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: copyright-and-license
|
||||||
|
:END:
|
||||||
|
|
||||||
|
Unless otherwise stated, all the examples in this directory are
|
||||||
|
released under the same terms as GPGME itself; that is they are dual
|
||||||
|
licensed under the terms of both the GNU General Public License
|
||||||
|
version 2.0 (or any later version) *and* the GNU Lesser General
|
||||||
|
Public License version 2.1 (or any later version).
|
||||||
|
|
||||||
|
|
||||||
|
** Copyright (C) The GnuPG Project, 2018
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: copyright
|
||||||
|
:END:
|
||||||
|
|
||||||
|
Copyright © The GnuPG Project, 2018.
|
||||||
|
|
||||||
|
|
||||||
|
** License GPL compatible
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: license
|
||||||
|
:END:
|
||||||
|
|
||||||
|
This file is free software; as a special exception the author gives
|
||||||
|
unlimited permission to copy and/or distribute it, with or without
|
||||||
|
modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
This file is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY, to the extent permitted by law; without even
|
||||||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE.
|
56
lang/python/examples/howto/clear-sign-file.py
Executable file
56
lang/python/examples/howto/clear-sign-file.py
Executable file
@ -0,0 +1,56 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
|
||||||
|
"""
|
||||||
|
Clear-signs a file with a specified key. If entering both the key and the
|
||||||
|
filename on the command line, the key must be entered first.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if len(sys.argv) > 3:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = " ".join(sys.argv[2:])
|
||||||
|
elif len(sys.argv) == 3:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = sys.argv[2]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = input("Enter the path and filename to sign: ")
|
||||||
|
else:
|
||||||
|
logrus = input("Enter the fingerprint or key ID to sign with: ")
|
||||||
|
filename = input("Enter the path and filename to sign: ")
|
||||||
|
|
||||||
|
with open(filename, "rb") as f:
|
||||||
|
text = f.read()
|
||||||
|
|
||||||
|
key = list(gpg.Context().keylist(pattern=logrus))
|
||||||
|
|
||||||
|
with gpg.Context(armor=True, signers=key) as c:
|
||||||
|
signed_data, result = c.sign(text, mode=gpg.constants.sig.mode.CLEAR)
|
||||||
|
with open("{0}.asc".format(filename), "wb") as f:
|
||||||
|
f.write(signed_data)
|
44
lang/python/examples/howto/decrypt-file.py
Executable file
44
lang/python/examples/howto/decrypt-file.py
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if len(sys.argv) == 3:
|
||||||
|
ciphertext = sys.argv[1]
|
||||||
|
newfile = sys.argv[2]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
ciphertext = sys.argv[1]
|
||||||
|
newfile = input("Enter path and filename of file to save decrypted data to: ")
|
||||||
|
else:
|
||||||
|
ciphertext = input("Enter path and filename of encrypted file: ")
|
||||||
|
newfile = input("Enter path and filename of file to save decrypted data to: ")
|
||||||
|
|
||||||
|
with open(ciphertext, "rb") as cfile:
|
||||||
|
plaintext, result, verify_result = gpg.Context().decrypt(cfile)
|
||||||
|
|
||||||
|
with open(newfile, "wb") as nfile:
|
||||||
|
nfile.write(plaintext)
|
64
lang/python/examples/howto/detach-sign-file.py
Executable file
64
lang/python/examples/howto/detach-sign-file.py
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
|
||||||
|
"""
|
||||||
|
Signs a file with a specified key. If entering both the key and the filename
|
||||||
|
on the command line, the key must be entered first.
|
||||||
|
|
||||||
|
Will produce both an ASCII armoured and GPG binary format copy of the detached
|
||||||
|
signature file.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if len(sys.argv) > 3:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = " ".join(sys.argv[2:])
|
||||||
|
elif len(sys.argv) == 3:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = sys.argv[2]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = input("Enter the path and filename to sign: ")
|
||||||
|
else:
|
||||||
|
logrus = input("Enter the fingerprint or key ID to sign with: ")
|
||||||
|
filename = input("Enter the path and filename to sign: ")
|
||||||
|
|
||||||
|
with open(filename, "rb") as f:
|
||||||
|
text = f.read()
|
||||||
|
|
||||||
|
key = list(gpg.Context().keylist(pattern=logrus))
|
||||||
|
|
||||||
|
with gpg.Context(armor=True, signers=key) as ca:
|
||||||
|
signed_data, result = ca.sign(text, mode=gpg.constants.sig.mode.DETACH)
|
||||||
|
with open("{0}.asc".format(filename), "wb") as fa:
|
||||||
|
fa.write(signed_data)
|
||||||
|
|
||||||
|
with gpg.Context(signers=key) as cb:
|
||||||
|
signed_data, result = cb.sign(text, mode=gpg.constants.sig.mode.DETACH)
|
||||||
|
with open("{0}.sig".format(filename), "wb") as fb:
|
||||||
|
fb.write(signed_data)
|
71
lang/python/examples/howto/encrypt-file.py
Executable file
71
lang/python/examples/howto/encrypt-file.py
Executable file
@ -0,0 +1,71 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
|
||||||
|
"""
|
||||||
|
Encrypts a file to a specified key. If entering both the key and the filename
|
||||||
|
on the command line, the key must be entered first.
|
||||||
|
|
||||||
|
Will produce both an ASCII armoured and GPG binary format copy of the encrypted
|
||||||
|
file.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if len(sys.argv) > 3:
|
||||||
|
a_key = sys.argv[1]
|
||||||
|
filename = " ".join(sys.argv[2:])
|
||||||
|
elif len(sys.argv) == 3:
|
||||||
|
a_key = sys.argv[1]
|
||||||
|
filename = sys.argv[2]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
a_key = sys.argv[1]
|
||||||
|
filename = input("Enter the path and filename to encrypt: ")
|
||||||
|
else:
|
||||||
|
a_key = input("Enter the fingerprint or key ID to encrypt to: ")
|
||||||
|
filename = input("Enter the path and filename to encrypt: ")
|
||||||
|
|
||||||
|
rkey = list(gpg.Context().keylist(pattern=a_key, secret=False))
|
||||||
|
with open(filename, "rb") as f:
|
||||||
|
text = f.read()
|
||||||
|
|
||||||
|
with gpg.Context(armor=True) as ca:
|
||||||
|
try:
|
||||||
|
ciphertext, result, sign_result = ca.encrypt(text, recipients=rkey,
|
||||||
|
sign=False)
|
||||||
|
with open("{0}.asc".format(filename), "wb") as fa:
|
||||||
|
fa.write(ciphertext)
|
||||||
|
except gpg.errors.InvalidRecipients as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
with gpg.Context() as cg:
|
||||||
|
try:
|
||||||
|
ciphertext, result, sign_result = cg.encrypt(text, recipients=rkey,
|
||||||
|
sign=False)
|
||||||
|
with open("{0}.gpg".format(filename), "wb") as fg:
|
||||||
|
fg.write(ciphertext)
|
||||||
|
except gpg.errors.InvalidRecipients as e:
|
||||||
|
print(e)
|
70
lang/python/examples/howto/encrypt-sign-file.py
Executable file
70
lang/python/examples/howto/encrypt-sign-file.py
Executable file
@ -0,0 +1,70 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
|
||||||
|
"""
|
||||||
|
Signs and encrypts a file to a specified key. If entering both the key and the
|
||||||
|
filename on the command line, the key must be entered first.
|
||||||
|
|
||||||
|
Signs with and also encrypts to the default key of the user invoking the
|
||||||
|
script. Will treat all recipients as trusted to permit encryption.
|
||||||
|
|
||||||
|
Will produce both an ASCII armoured and GPG binary format copy of the signed
|
||||||
|
and encrypted file.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if len(sys.argv) > 3:
|
||||||
|
a_key = sys.argv[1]
|
||||||
|
filename = " ".join(sys.argv[2:])
|
||||||
|
elif len(sys.argv) == 3:
|
||||||
|
a_key = sys.argv[1]
|
||||||
|
filename = sys.argv[2]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
a_key = sys.argv[1]
|
||||||
|
filename = input("Enter the path and filename to encrypt: ")
|
||||||
|
else:
|
||||||
|
a_key = input("Enter the fingerprint or key ID to encrypt to: ")
|
||||||
|
filename = input("Enter the path and filename to encrypt: ")
|
||||||
|
|
||||||
|
rkey = list(gpg.Context().keylist(pattern=a_key, secret=False))
|
||||||
|
with open(filename, "rb") as f:
|
||||||
|
text = f.read()
|
||||||
|
|
||||||
|
with gpg.Context(armor=True) as ca:
|
||||||
|
ciphertext, result, sign_result = ca.encrypt(text, recipients=rkey,
|
||||||
|
always_trust=True,
|
||||||
|
add_encrypt_to=True)
|
||||||
|
with open("{0}.asc".format(filename), "wb") as fa:
|
||||||
|
fa.write(ciphertext)
|
||||||
|
|
||||||
|
with gpg.Context() as cg:
|
||||||
|
ciphertext, result, sign_result = cg.encrypt(text, recipients=rkey,
|
||||||
|
always_trust=True,
|
||||||
|
add_encrypt_to=True)
|
||||||
|
with open("{0}.gpg".format(filename), "wb") as fg:
|
||||||
|
fg.write(ciphertext)
|
50
lang/python/examples/howto/groups.py
Normal file
50
lang/python/examples/howto/groups.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
"""
|
||||||
|
Intended for use with other scripts.
|
||||||
|
|
||||||
|
Usage: from groups import group_lists
|
||||||
|
"""
|
||||||
|
|
||||||
|
lines = subprocess.getoutput("gpgconf --list-options gpg").splitlines()
|
||||||
|
|
||||||
|
for i in range(len(lines)):
|
||||||
|
if lines[i].startswith("group") is True:
|
||||||
|
line = lines[i]
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
groups = line.split(":")[-1].replace('"', '').split(',')
|
||||||
|
|
||||||
|
group_lines = groups
|
||||||
|
for i in range(len(group_lines)):
|
||||||
|
group_lines[i] = group_lines[i].split("=")
|
||||||
|
|
||||||
|
group_lists = group_lines
|
||||||
|
for i in range(len(group_lists)):
|
||||||
|
group_lists[i][1] = group_lists[i][1].split()
|
42
lang/python/examples/howto/keycount.py
Executable file
42
lang/python/examples/howto/keycount.py
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
|
||||||
|
c = gpg.Context()
|
||||||
|
seckeys = c.keylist(pattern=None, secret=True)
|
||||||
|
pubkeys = c.keylist(pattern=None, secret=False)
|
||||||
|
|
||||||
|
seclist = list(seckeys)
|
||||||
|
secnum = len(seclist)
|
||||||
|
|
||||||
|
publist = list(pubkeys)
|
||||||
|
pubnum = len(publist)
|
||||||
|
|
||||||
|
print("""
|
||||||
|
Number of secret keys: {0}
|
||||||
|
Number of public keys: {1}
|
||||||
|
""".format(secnum, pubnum))
|
64
lang/python/examples/howto/sign-file.py
Executable file
64
lang/python/examples/howto/sign-file.py
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
|
||||||
|
"""
|
||||||
|
Signs a file with a specified key. If entering both the key and the filename
|
||||||
|
on the command line, the key must be entered first.
|
||||||
|
|
||||||
|
Will produce both an ASCII armoured and GPG binary format copy of the signed
|
||||||
|
file.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if len(sys.argv) > 3:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = " ".join(sys.argv[2:])
|
||||||
|
elif len(sys.argv) == 3:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = sys.argv[2]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
logrus = sys.argv[1]
|
||||||
|
filename = input("Enter the path and filename to sign: ")
|
||||||
|
else:
|
||||||
|
logrus = input("Enter the fingerprint or key ID to sign with: ")
|
||||||
|
filename = input("Enter the path and filename to sign: ")
|
||||||
|
|
||||||
|
with open(filename, "rb") as f:
|
||||||
|
text = f.read()
|
||||||
|
|
||||||
|
key = list(gpg.Context().keylist(pattern=logrus))
|
||||||
|
|
||||||
|
with gpg.Context(armor=True, signers=key) as ca:
|
||||||
|
signed_data, result = ca.sign(text, mode=gpg.constants.sig.mode.NORMAL)
|
||||||
|
with open("{0}.asc".format(filename), "wb") as fa:
|
||||||
|
fa.write(signed_data)
|
||||||
|
|
||||||
|
with gpg.Context(signers=key) as cg:
|
||||||
|
signed_data, result = cg.sign(text, mode=gpg.constants.sig.mode.NORMAL)
|
||||||
|
with open("{0}.gpg".format(filename), "wb") as fg:
|
||||||
|
fg.write(signed_data)
|
64
lang/python/examples/howto/verify-signatures.py
Executable file
64
lang/python/examples/howto/verify-signatures.py
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
"""
|
||||||
|
Verifies a signed file which has been signed with a detached signature.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if len(sys.argv) > 2:
|
||||||
|
filename = sys.argv[1]
|
||||||
|
sig_file = sys.argv[2]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
filename = sys.argv[1]
|
||||||
|
sig_file = input("Enter the path and filename of the detached signature: ")
|
||||||
|
else:
|
||||||
|
filename = input("Enter the path and filename to verify: ")
|
||||||
|
sig_file = input("Enter the path and filename of the detached signature: ")
|
||||||
|
|
||||||
|
c = gpg.Context()
|
||||||
|
|
||||||
|
try:
|
||||||
|
data, result = c.verify(open(filename), open(sig_file))
|
||||||
|
verified = True
|
||||||
|
except gpg.errors.BadSignatures as e:
|
||||||
|
verified = False
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
if verified is True:
|
||||||
|
for i in range(len(result.signatures)):
|
||||||
|
sign = result.signatures[i]
|
||||||
|
print("""Good signature from:
|
||||||
|
{0}
|
||||||
|
with key {1}
|
||||||
|
made at {2}
|
||||||
|
""".format(c.get_key(sign.fpr).uids[0].uid, sign.fpr,
|
||||||
|
time.ctime(sign.timestamp)))
|
||||||
|
else:
|
||||||
|
pass
|
61
lang/python/examples/howto/verify-signed-file.py
Executable file
61
lang/python/examples/howto/verify-signed-file.py
Executable file
@ -0,0 +1,61 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public Licensefor more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
|
# Lesser General Public along with this program; if not, see
|
||||||
|
# <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import gpg
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
"""
|
||||||
|
Verifies a signed file which has been signed with either NORMAL or CLEAR modes.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if len(sys.argv) > 2:
|
||||||
|
filename = " ".join(sys.argv[1:])
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
filename = sys.argv[1]
|
||||||
|
else:
|
||||||
|
filename = input("Enter the path and filename to sign: ")
|
||||||
|
|
||||||
|
c = gpg.Context()
|
||||||
|
|
||||||
|
try:
|
||||||
|
data, result = c.verify(open(filename))
|
||||||
|
verified = True
|
||||||
|
except gpg.errors.BadSignatures as e:
|
||||||
|
verified = False
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
if verified is True:
|
||||||
|
for i in range(len(result.signatures)):
|
||||||
|
sign = result.signatures[i]
|
||||||
|
print("""Good signature from:
|
||||||
|
{0}
|
||||||
|
with key {1}
|
||||||
|
made at {2}
|
||||||
|
""".format(c.get_key(sign.fpr).uids[0].uid, sign.fpr,
|
||||||
|
time.ctime(sign.timestamp)))
|
||||||
|
else:
|
||||||
|
pass
|
@ -3101,7 +3101,7 @@ cmd_hash_algo_name (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
|
|
||||||
static const char hlp_identify[] =
|
static const char hlp_identify[] =
|
||||||
"IDENTIY\n"
|
"IDENTIFY\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Identify the type of data set with the INPUT command.";
|
"Identify the type of data set with the INPUT command.";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
|
Loading…
Reference in New Issue
Block a user