<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,7 @@
 // Imports a key given in the query string.
 
 #include &lt;gpgme.h&gt;
+#include &lt;time.h&gt;
 #include &lt;stdio.h&gt;   
 #include &lt;string.h&gt;   
 #include &lt;stdlib.h&gt;  
@@ -19,11 +20,12 @@ int initialize_context(gpgme_ctx_t *);
 int main()
 {
   char *bptr, *query_string, *content_len;
-  char *buf, *strkey;
+  char *buf, *strkey, *strsignkeyid;
   int clen, found;
   char * pKey, *pVal, *pEnd;
-  int keylen, vallen;
+  int keylen, vallen, printed = 0;
   size_t read_bytes;
+  char timebuf[60];
 
   /* GPGME Variables */
   gpgme_ctx_t ceofcontext;
@@ -118,26 +120,49 @@ int main()
     for(; *bptr &amp;&amp; *bptr != '&amp;'; bptr++);
     vallen = bptr - pVal;
     // Do the magic
-    if(strncmp(&quot;key=&quot;, pKey, 4) == 0) {
+    if(strncmp(&quot;key=&quot;, pKey, keylen+1) == 0) {
       strkey = malloc(vallen+1);
-      memcpy(strkey, pKey+4, vallen);
+      memcpy(strkey, pVal, vallen);
       strkey[vallen] == '0';
       URLDecode(strkey);
     }
+    else if(strncmp(&quot;signer_key=&quot;, pKey, keylen+1) == 0) {
+      if(pVal[0] == '0' &amp;&amp; 
+          (pVal[1] == 'x' || strsignkeyid[1] == 'X')
+        ) {
+         vallen -= 2;
+         pVal += 2; 
+      }
+      if(vallen != 8 &amp;&amp; vallen != 16) {
+        printf(&quot;&lt;p&gt;Invalid Signer Key ID.  Formatting like any of the following will do:&lt;/p&gt;&quot;);
+        printf(&quot;&lt;ul&gt;&quot;);
+        printf(&quot;&lt;li&gt;F693F0F246C171A0&lt;/li&gt;&quot;);
+        printf(&quot;&lt;li&gt;46C171A0&lt;/li&gt;&quot;);
+        printf(&quot;&lt;li&gt;0xF693F0F246C171A0&lt;/li&gt;&quot;);
+        printf(&quot;&lt;li&gt;0x46C171A0&lt;/li&gt;&quot;);
+        printf(&quot;&lt;/ul&gt;&quot;);
+        fflush(stdout);
+        return 0;
+      }
+      strsignkeyid = malloc(vallen+1);
+      memcpy(strsignkeyid, pVal, vallen);
+      strsignkeyid[vallen] == '0';
+      URLDecode(strsignkeyid);
+      printf(&quot;&lt;/p&gt;Signer Key: %s&lt;p&gt;&quot;, strsignkeyid, strlen(strsignkeyid));
+    }
     if(*bptr == '\0') {
       // We're done here.  Last value
       break;
     }
     bptr++;
   }
-  //printf(&quot;&lt;pre&gt;%s&lt;/pre&gt;&quot;, strkey);
 
   err = initialize_context(&amp;ceofcontext);
   if(err != GPG_ERR_NO_ERROR) goto gpg_err;
 
   /* set encoding for the buffer... */
-  err = gpgme_data_set_encoding(rdata,GPGME_DATA_ENCODING_ARMOR);
-  if(err != GPG_ERR_NO_ERROR) goto gpg_err;
+  //err = gpgme_data_set_encoding(rdata,GPGME_DATA_ENCODING_ARMOR);
+  //if(err != GPG_ERR_NO_ERROR) goto gpg_err;
 
   err = gpgme_set_keylist_mode(ceofcontext, GPGME_KEYLIST_MODE_SIGS);
   if(err != GPG_ERR_NO_ERROR) goto gpg_err;
@@ -165,21 +190,68 @@ int main()
 
   uid = key-&gt;uids;
   if(!uid) {
-    printf(&quot;&lt;p&gt;No UIDs found.  Please check key,&lt;/p&gt;&quot;);
+    printf(&quot;&lt;p&gt;No UIDs found.  Please check key&lt;/p&gt;&quot;);
     fflush(stdout);
     return 0;
   }
-
+  printf(&quot;&lt;ul&gt;&quot;);
   do {
-    printf(&quot;&lt;p&gt;Found UID: %s&lt;/p&gt;&quot;, uid-&gt;uid);
-    fflush(stdout);
     sig = uid-&gt;signatures;
     if(!sig) continue;
     do {
-      printf(&quot;&lt;p&gt;Found SIG: %s&lt;/p&gt;&quot;, sig-&gt;keyid);
-      fflush(stdout);
+      if((strcasecmp(sig-&gt;keyid, strsignkeyid) == 0) ||
+         (strcasecmp(&amp;sig-&gt;keyid[8], strsignkeyid) == 0)
+        ) {
+        // This UID is signed.
+
+        // We don't care about revoked UIDs.
+        if(uid-&gt;revoked || uid-&gt;invalid) break;
+        if(!printed) {
+          // Print relavent UID information
+          printf(&quot;&lt;li&gt;%s &quot;, uid-&gt;uid);
+          printf(&quot;&lt;ul&gt;&quot;);
+          fflush(stdout);
+          printed = 1;
+        }
+        // Print relevent signature information
+        printf(&quot;&lt;li&gt;%s &quot;, sig-&gt;keyid);
+        switch(sig-&gt;sig_class) {
+          case 0x10:
+            printf(&quot;Generic Level &quot;);
+            break;
+          case 0x11:
+            printf(&quot;Persona Level &quot;);
+            break;
+          case 0x12:
+            printf(&quot;Casual Level &quot;);
+            break;
+          case 0x13:
+            printf(&quot;Positive Level&quot;);
+            break;
+        }
+        if(sig-&gt;revoked) printf(&quot;&lt;b&gt;Revoked&lt;/b&gt; &quot;);
+        if(sig-&gt;expired) printf(&quot;&lt;b&gt;Expired&lt;/b&gt; &quot;);
+        if(sig-&gt;invalid) printf(&quot;&lt;b&gt;Invalid&lt;/b&gt; &quot;);
+        if(!sig-&gt;exportable) printf(&quot;&lt;b&gt;Non-exportable&lt;/b&gt; &quot;);
+        printf(&quot;Signature &quot;);
+        if(sig-&gt;timestamp != 0 &amp;&amp; sig-&gt;timestamp != -1) { 
+          strftime(timebuf, 59, &quot;%Y/%m/%d %H:%M:%S %Z&quot;, gmtime(&amp;sig-&gt;timestamp));
+          printf(&quot;Made on %s &quot;, timebuf);
+        } 
+        if(sig-&gt;expires != 0) { 
+          strftime(timebuf, 59, &quot;%Y/%m/%d %H:%M:%S %Z&quot;, gmtime(&amp;sig-&gt;expires));
+          printf(&quot;Expires on %s&quot;, timebuf);
+        } 
+        printf(&quot;&lt;/li&gt;&quot;);
+        
+        fflush(stdout);
+      }
     } while((sig = sig-&gt;next) != NULL);
+    if(printed) printf(&quot;&lt;/ul&gt;&lt;/li&gt;&quot;);
+    printed = 0;
   } while((uid = uid-&gt;next) != NULL);
+  printf(&quot;&lt;/ul&gt;&quot;);
+  fflush(stdout);
 
   /* free data */
   gpgme_data_release(rdata);
@@ -190,7 +262,8 @@ int main()
   return 0;
 
 gpg_err:
-  printf(&quot;&lt;p&gt;GPG Error: %s&lt;/p&gt;&quot;, gpgme_strerror(err)); fflush(stdout);
+  printf(&quot;&lt;p&gt;GPG Error&lt;/p&gt;&quot;);
+  fflush(stdout);
   return 0;
 }
 
@@ -227,8 +300,8 @@ int initialize_context(gpgme_ctx_t * ceofcontext)
   err = gpgme_get_engine_info(&amp;enginfo);
   if(err != GPG_ERR_NO_ERROR) goto gpg_err_2;
 
-  printf(&quot;file=%s, home=%s\n&quot;,enginfo-&gt;file_name,enginfo-&gt;home_dir); fflush(stdout);
-  fflush(stdout);
+  //printf(&quot;file=%s, home=%s\n&quot;,enginfo-&gt;file_name,enginfo-&gt;home_dir); fflush(stdout);
+  //fflush(stdout);
 
   /* set protocol to use in our context */
   err = gpgme_set_protocol(*ceofcontext,GPGME_PROTOCOL_OpenPGP);</diff>
      <filename>code/c/giganticlumber/import_key.c</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@
   &lt;table&gt;
   &lt;tr&gt;
     &lt;td&gt;&lt;label&gt;Your key ID&lt;/label&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;signer_id&quot; /&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;signer_key&quot; /&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
     &lt;td&gt;&lt;label&gt;The signed key of the other party&lt;/label&gt;&lt;/td&gt;</diff>
      <filename>code/c/giganticlumber/index.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cd677214cc9df33903b6ade149b0adba605ee60f</id>
    </parent>
  </parents>
  <author>
    <name>Erik Gregg</name>
    <email>ralree@gmail.com</email>
  </author>
  <url>http://github.com/hank/life/commit/551820ac48e2695c45c849c22e98ab79c76ec62c</url>
  <id>551820ac48e2695c45c849c22e98ab79c76ec62c</id>
  <committed-date>2009-11-15T19:06:06-08:00</committed-date>
  <authored-date>2009-11-15T19:06:06-08:00</authored-date>
  <message>Major improvements to GiganticLumber</message>
  <tree>0f9222c6d3d851e95c8e4cd1bb3cb1665bccd273</tree>
  <committer>
    <name>Erik Gregg</name>
    <email>ralree@gmail.com</email>
  </committer>
</commit>
