aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyid.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-09-23 13:32:31 +0000
committerWerner Koch <[email protected]>2004-09-23 13:32:31 +0000
commit42c18de83a8eab8d4da3e4d4193a8750cf8ba6be (patch)
tree1ef5722c3febb23acd01cb49bf266dfd370a6047 /g10/keyid.c
parent* mainproc.c (check_sig_and_print), keyedit.c (show_prefs, (diff)
downloadgnupg-42c18de83a8eab8d4da3e4d4193a8750cf8ba6be.tar.gz
gnupg-42c18de83a8eab8d4da3e4d4193a8750cf8ba6be.zip
* gpg.sgml: Document "addcardkey" and "keytocard".
* apdu.c (open_pcsc_reader): Do not print empty reader string. * keygen.c (ask_algo): Allow creation of AUTH keys. * keyid.c (usagestr_from_pk): New. * app-openpgp.c (app_openpgp_storekey): Call flush_cache. * keyedit.c (keyedit_menu): New command "keytocard" (keyedit_menu): Bad hack for the not_with_sk element. (show_key_with_all_names): Print the usage. (find_pk_from_sknode): New. * card-util.c (card_store_subkey): New. (copy_mpi): New. * cardglue.c (agent_openpgp_storekey): New.
Diffstat (limited to 'g10/keyid.c')
-rw-r--r--g10/keyid.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/g10/keyid.c b/g10/keyid.c
index 9d987179d..9c5138605 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -535,6 +535,35 @@ revokestr_from_pk( PKT_public_key *pk )
return mk_datestr (buffer, atime);
}
+
+const char *
+usagestr_from_pk( PKT_public_key *pk )
+{
+ static char buffer[10];
+ int i = 0;
+ unsigned int use = pk->pubkey_usage;
+
+ if ( use & PUBKEY_USAGE_SIG )
+ {
+ if (pk->is_primary)
+ buffer[i++] = 'C';
+ buffer[i++] = 'S';
+ }
+
+ if ( use & PUBKEY_USAGE_ENC )
+ buffer[i++] = 'E';
+
+ if ( (use & PUBKEY_USAGE_AUTH) )
+ buffer[i++] = 'A';
+
+ while (i < 4)
+ buffer[i++] = ' ';
+
+ buffer[i] = 0;
+ return buffer;
+}
+
+
const char *
colon_strtime (u32 t)
{