diff options
author | Martin Willi <martin@revosec.ch> | 2010-12-15 14:30:09 +0000 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-01-05 16:46:02 +0100 |
commit | 3ffc9d9a881675df1f8403db625860fad328efd0 (patch) | |
tree | 7737a9e15645d6b106f61fe32eaff67c556aea61 /src/pki/commands/print.c | |
parent | 5a0caa4b3a9431eb8ced8ed00292b88a341d4e8e (diff) | |
download | strongswan-3ffc9d9a881675df1f8403db625860fad328efd0.tar.bz2 strongswan-3ffc9d9a881675df1f8403db625860fad328efd0.tar.xz |
Added policyMappings support to pki tool
Diffstat (limited to 'src/pki/commands/print.c')
-rw-r--r-- | src/pki/commands/print.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pki/commands/print.c b/src/pki/commands/print.c index af0c92cd4..23fb644e1 100644 --- a/src/pki/commands/print.c +++ b/src/pki/commands/print.c @@ -76,6 +76,7 @@ static void print_x509(x509_t *x509) int len; x509_flag_t flags; x509_cert_policy_t *policy; + x509_policy_mapping_t *mapping; chunk = x509->get_serial(x509); printf("serial: %#B\n", &chunk); @@ -238,6 +239,25 @@ static void print_x509(x509_t *x509) } enumerator->destroy(enumerator); + first = TRUE; + enumerator = x509->create_policy_mapping_enumerator(x509); + while (enumerator->enumerate(enumerator, &mapping)) + { + char *issuer_oid, *subject_oid; + + if (first) + { + printf("PolicyMappings:\n"); + first = FALSE; + } + issuer_oid = asn1_oid_to_string(mapping->issuer); + subject_oid = asn1_oid_to_string(mapping->subject); + printf(" %s => %s\n", issuer_oid, subject_oid); + free(issuer_oid); + free(subject_oid); + } + enumerator->destroy(enumerator); + chunk = x509->get_authKeyIdentifier(x509); if (chunk.ptr) { |