Changing trust in GPGME

Piotr Bratkowski pioterbrat at o2.pl
Tue Jan 12 23:41:52 CET 2010


#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <gpgme.h>
Hello,

I have this code. And when I see output owner_trust = 4, but in gpg from 
system I get 0. Do I need to somehow save this changes??

#include "t-support.h"
int
main (int argc, char **argv)
{
 gpgme_ctx_t ctx;
 gpgme_error_t err;
 gpgme_key_t key;
 const char* key_t;
 init_gpgme(GPGME_PROTOCOL_OpenPGP);
 err = gpgme_new(&ctx);
 err = gpgme_op_keylist_start(ctx,NULL,0);
 int i = 0;
 char *key_sig;

 while(!(err = gpgme_op_keylist_next (ctx,&key))) {
  if(key->owner_trust==0)
  {
  key->owner_trust=GPGME_VALIDITY_FULL;
  fprintf(stderr,"%i : Key owner= %s fingerprint= %s trust= 
%i\n",i,key->uids->name,key->subkeys->fpr,key->owner_trust);
  }
 }
}

Regards,
Piotr Bratkowski



More information about the Gnupg-users mailing list