aboutsummaryrefslogtreecommitdiffstats
path: root/tests/t-keylist.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2001-01-08 20:40:25 +0000
committerWerner Koch <[email protected]>2001-01-08 20:40:25 +0000
commitd6cd1f97cab9cbb08560825444c1f848ac45f840 (patch)
treed878d785f249a37771db47507e0dbc64c8145502 /tests/t-keylist.c
parentAdd 2 missing files and other changes (diff)
downloadgpgme-d6cd1f97cab9cbb08560825444c1f848ac45f840.tar.gz
gpgme-d6cd1f97cab9cbb08560825444c1f848ac45f840.zip
More changes and and some new functions
Diffstat (limited to '')
-rw-r--r--tests/t-keylist.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/t-keylist.c b/tests/t-keylist.c
index e07da463..d17c8da3 100644
--- a/tests/t-keylist.c
+++ b/tests/t-keylist.c
@@ -42,12 +42,32 @@ doit ( GpgmeCtx ctx, const char *pattern )
while ( !(err = gpgme_op_keylist_next ( ctx, &key )) ) {
char *p;
+ const char *s;
+ int i;
+
printf ("<!-- Begin key object (%p) -->\n", key );
p = gpgme_key_get_as_xml ( key );
- if ( p )
+ if ( p ) {
fputs ( p, stdout );
+ free (p);
+ }
else
fputs("<!-- Ooops: gpgme_key_get_as_xml failed -->\n", stdout );
+
+ s = gpgme_key_get_string_attr (key, GPGME_ATTR_KEYID, NULL, 0 );
+ printf ("<!-- keyid=%s -->\n", s );
+ s = gpgme_key_get_string_attr (key, GPGME_ATTR_ALGO, NULL, 0 );
+ printf ("<!-- algo=%s -->\n", s );
+ for (i=0; ; i++ ) {
+ s = gpgme_key_get_string_attr (key, GPGME_ATTR_NAME, NULL, i );
+ if (!s)
+ break;
+ printf ("<!-- name.%d=%s -->\n", i, s );
+ s = gpgme_key_get_string_attr (key, GPGME_ATTR_EMAIL, NULL, i );
+ printf ("<!-- email.%d=%s -->\n", i, s );
+ s = gpgme_key_get_string_attr (key, GPGME_ATTR_COMMENT, NULL, i );
+ printf ("<!-- comment.%d=%s -->\n", i, s );
+ }
printf ("<!-- End key object (%p) -->\n", key );
}
if ( err != GPGME_EOF )