aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/key2keyid.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/key2keyid.c')
-rw-r--r--scripts/key2keyid.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/scripts/key2keyid.c b/scripts/key2keyid.c
index 201670e43..15d13238c 100644
--- a/scripts/key2keyid.c
+++ b/scripts/key2keyid.c
@@ -37,10 +37,18 @@ int main(int argc, char *argv[])
printf("parsed %d bits %N private key.\n",
private->get_keysize(private)*8,
key_type_names, private->get_type(private));
- printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_INFO_SHA1,
- private->get_id(private, ID_PUBKEY_INFO_SHA1));
- printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_SHA1,
- private->get_id(private, ID_PUBKEY_SHA1));
+ if (private->get_fingerprint(private, KEY_ID_PUBKEY_INFO_SHA1, &chunk))
+ {
+ printf("subjectPublicKeyInfo keyid: %#B\n", &chunk);
+ }
+ if (private->get_fingerprint(private, KEY_ID_PUBKEY_SHA1, &chunk))
+ {
+ printf("subjectPublicKey keyid: %#B\n", &chunk);
+ }
+ if (private->get_fingerprint(private, KEY_ID_PGPV3, &chunk))
+ {
+ printf("PGP verison 3 keyid: %#B\n", &chunk);
+ }
private->destroy(private);
return 0;
}
@@ -59,10 +67,18 @@ int main(int argc, char *argv[])
printf("parsed %d bits %N public key.\n",
public->get_keysize(public)*8,
key_type_names, public->get_type(public));
- printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_INFO_SHA1,
- public->get_id(public, ID_PUBKEY_INFO_SHA1));
- printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_SHA1,
- public->get_id(public, ID_PUBKEY_SHA1));
+ if (public->get_fingerprint(public, KEY_ID_PUBKEY_INFO_SHA1, &chunk))
+ {
+ printf("subjectPublicKeyInfo keyid: %#B\n", &chunk);
+ }
+ if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1, &chunk))
+ {
+ printf("subjectPublicKey keyid: %#B\n", &chunk);
+ }
+ if (public->get_fingerprint(public, KEY_ID_PGPV3, &chunk))
+ {
+ printf("PGP verison 3 keyid: %#B\n", &chunk);
+ }
public->destroy(public);
return 0;
}