manpagez: man pages & more
info gpgme
Home | html | info | man

File: gpgme.info,  Node: Setting the Sender,  Next: ASCII Armor,  Prev: Crypto Engine,  Up: Context Attributes

7.4.3 How to tell the engine the sender.
----------------------------------------

Some engines can make use of the sender’s address, for example to figure
out the best user id in certain trust models.  For verification and
signing of mails, it is thus suggested to let the engine know the sender
("From:") address.  GPGME provides two functions to accomplish that.
Note that the esoteric use of multiple "From:" addresses is not
supported.

 -- Function: gpgme_error_t gpgme_set_sender (gpgme_ctx_t CTX,
          int ADDRESS)

     SINCE: 1.8.0

     The function ‘gpgme_set_sender’ specifies the sender address for
     use in sign and verify operations.  ADDRESS is expected to be the
     “addr-spec” part of an address but my also be a complete mailbox
     address, in which case this function extracts the “addr-spec” from
     it.  Using ‘NULL’ for ADDRESS clears the sender address.

     The function returns 0 on success or an error code on failure.  The
     most likely failure is that no valid “addr-spec” was found in
     ADDRESS.

 -- Function: const char * gpgme_get_sender (gpgme_ctx_t CTX)

     SINCE: 1.8.0

     The function ‘gpgme_get_sender’ returns the current sender address
     from the context, or NULL if none was set.  The returned value is
     valid as long as the CTX is valid and ‘gpgme_set_sender’ has not
     been called again.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.