Migrated ike_mobike task to INIT/METHOD macros.
[strongswan.git] / scripts / key2keyid.c
index cc3e0b1..6a8301c 100644 (file)
@@ -17,7 +17,7 @@ int main(int argc, char *argv[])
        int read;
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, PLUGINS);
+       lib->plugins->load(lib->plugins, NULL, PLUGINS);
        atexit(library_deinit);
 
        read = fread(buf, 1, sizeof(buf), stdin);
@@ -35,19 +35,19 @@ int main(int argc, char *argv[])
        if (private)
        {
                printf("parsed %d bits %N private key.\n",
-                          private->get_keysize(private)*8,
+                          private->get_keysize(private),
                           key_type_names, private->get_type(private));
-               if (private->get_fingerprint(private, KEY_ID_PUBKEY_INFO_SHA1, &chunk))
+               if (private->get_fingerprint(private, KEYID_PUBKEY_INFO_SHA1, &chunk))
                {
                        printf("subjectPublicKeyInfo keyid: %#B\n", &chunk);
                }
-               if (private->get_fingerprint(private, KEY_ID_PUBKEY_SHA1, &chunk))
+               if (private->get_fingerprint(private, KEYID_PUBKEY_SHA1, &chunk))
                {
                        printf("subjectPublicKey keyid:     %#B\n", &chunk);
                }
-               if (private->get_fingerprint(private, KEY_ID_PGPV3, &chunk))
+               if (private->get_fingerprint(private, KEYID_PGPV3, &chunk))
                {
-                       printf("PGP verison 3 keyid:        %#B\n", &chunk);
+                       printf("PGP version 3 keyid:        %#B\n", &chunk);
                }
                private->destroy(private);
                return 0;
@@ -65,19 +65,19 @@ int main(int argc, char *argv[])
        if (public)
        {
                printf("parsed %d bits %N public key.\n",
-                          public->get_keysize(public)*8,
+                          public->get_keysize(public),
                           key_type_names, public->get_type(public));
-               if (public->get_fingerprint(public, KEY_ID_PUBKEY_INFO_SHA1, &chunk))
+               if (public->get_fingerprint(public, KEYID_PUBKEY_INFO_SHA1, &chunk))
                {
                        printf("subjectPublicKeyInfo keyid: %#B\n", &chunk);
                }
-               if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1, &chunk))
+               if (public->get_fingerprint(public, KEYID_PUBKEY_SHA1, &chunk))
                {
                        printf("subjectPublicKey keyid:     %#B\n", &chunk);
                }
-               if (public->get_fingerprint(public, KEY_ID_PGPV3, &chunk))
+               if (public->get_fingerprint(public, KEYID_PGPV3, &chunk))
                {
-                       printf("PGP verison 3 keyid:        %#B\n", &chunk);
+                       printf("PGP version 3 keyid:        %#B\n", &chunk);
                }
                public->destroy(public);
                return 0;