File: gpgme.info, Node: Manipulating Keys, Next: Generating Keys, Prev: Information About Keys, Up: Key Management 7.5.4 Manipulating Keys ----------------------- -- Function: void gpgme_key_ref (gpgme_key_t KEY) The function ‘gpgme_key_ref’ acquires an additional reference for the key KEY. -- Function: void gpgme_key_unref (gpgme_key_t KEY) The function ‘gpgme_key_unref’ releases a reference for the key KEY. If this was the last reference, the key will be destroyed and all resources associated to it will be released. -- Function: gpgme_error_t gpgme_op_setexpire (gpgme_ctx_t CTX, gpgme_key_t KEY, unsigned long EXPIRES, const char *SUBFPRS, unsigned int RESERVED); SINCE: 1.14.1 The function ‘gpgme_op_setexpire’ sets the expiration time of the key KEY or of the specified subkeys. This function requires at least version 2.1.22 of GnuPG. KEY specifies the key to operate on. EXPIRES specifies the expiration time in seconds from now. To be similar to other usages where expiration times are provided in unsigned long this is similar to the key creation date and so it is in seconds from NOW. The common case is to use 0 to not set an expiration time. Note that this parameter takes an unsigned long value and not a ‘time_t’ to avoid problems on systems which use a signed 32 bit ‘time_t’. Note further that the OpenPGP protocol uses 32 bit values for timestamps and thus can only encode dates up to the year 2106. SUBFPRS selects the subkey(s) for which the expiration time should be set. If SUBFPRS is set to ‘NULL’, then the expiration time of the primary key is set. If SUBFPRS is an asterisk (‘*’), then the expiration times of all non-revoked and not yet expired subkeys are set. To select more than one subkey put all subkey fingerprints into one string separated by linefeeds characters (‘\n’). RESERVED is reserved for later use and must be ‘0’. -- Function: gpgme_error_t gpgme_op_setexpire_start (gpgme_ctx_t CTX, gpgme_key_t KEY, unsigned long EXPIRES, const char *SUBFPRS, unsigned int FLAGS); SINCE: 1.14.1 The function ‘gpgme_op_setexpire_start’ initiates a ‘gpgme_op_setexpire’ operation; see there for details. It must be completed by calling ‘gpgme_wait’ on the context. *Note Waiting For Completion::.