diff options
-rw-r--r-- | trust/list.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/trust/list.c b/trust/list.c index a7fa4d9..c3f5759 100644 --- a/trust/list.c +++ b/trust/list.c @@ -44,6 +44,7 @@ #include "message.h" #include "pkcs11x.h" #include "tool.h" +#include "url.h" #include "p11-kit/iter.h" @@ -83,11 +84,13 @@ static bool list_iterate (p11_enumerate *ex, bool details) { + unsigned char *bytes; CK_OBJECT_HANDLE object; CK_ATTRIBUTE *attr; CK_ULONG klass; CK_ULONG category; CK_BBOOL val; + p11_buffer buf; CK_RV rv; const char *nick; char *string; @@ -142,6 +145,17 @@ list_iterate (p11_enumerate *ex, printf (" category: %s\n", nick); } + if (details) { + attr = p11_attrs_find_valid (ex->attrs, CKA_X_PUBLIC_KEY_INFO); + if (attr) { + p11_buffer_init (&buf, 1024); + bytes = attr->pValue; + p11_url_encode (bytes, bytes + attr->ulValueLen, "", &buf); + printf (" public-key-info: %.*s\n", (int)buf.len, (char *)buf.data); + p11_buffer_uninit (&buf); + } + } + printf ("\n"); } |