added display of holderIssuer, holderSerial, and authorityKeyIdentifier

This commit is contained in:
Andreas Steffen
2008-05-23 14:24:24 +00:00
parent 8cc16c9d9e
commit 0672aa7b0e
3 changed files with 95 additions and 4 deletions
+27 -1
View File
@@ -20,6 +20,7 @@
#include <daemon.h>
#include <utils/linked_list.h>
#include <credentials/certificates/x509.h>
#include <credentials/certificates/ac.h>
#include <credentials/certificates/crl.h>
/* warning intervals for list functions */
@@ -471,6 +472,13 @@ static void stroke_list_acerts(linked_list_t *list, bool utc, FILE *out)
while (enumerator->enumerate(enumerator, (void**)&cert))
{
ac_t *ac = (ac_t*)cert;
chunk_t serial = ac->get_serial(ac);
chunk_t holderSerial = ac->get_holderSerial(ac);
identification_t *holderIssuer = ac->get_holderIssuer(ac);
identification_t *authkey = ac->get_authKeyIdentifier(ac);
identification_t *entityName = cert->get_subject(cert);
if (first)
{
fprintf(out, "\n");
@@ -479,8 +487,20 @@ static void stroke_list_acerts(linked_list_t *list, bool utc, FILE *out)
}
fprintf(out, "\n");
fprintf(out, " holder: \"%D\"\n", cert->get_subject(cert));
if (entityName)
{
fprintf(out, " holder: \"%D\"\n", entityName);
}
if (holderIssuer)
{
fprintf(out, " hissuer: \"%D\"\n", holderIssuer);
}
if (holderSerial.ptr)
{
fprintf(out, " hserial: %#B\n", &holderSerial);
}
fprintf(out, " issuer: \"%D\"\n", cert->get_issuer(cert));
fprintf(out, " serial: %#B\n", &serial);
/* list validity */
cert->get_validity(cert, &now, &thisUpdate, &nextUpdate);
@@ -499,6 +519,12 @@ static void stroke_list_acerts(linked_list_t *list, bool utc, FILE *out)
}
fprintf(out, " \n");
}
/* list optional authorityKeyIdentifier */
if (authkey)
{
fprintf(out, " authkey: %D\n", authkey);
}
}
enumerator->destroy(enumerator);
}