accept PEM encoded keys in keyid scripts
authorMartin Willi <martin@strongswan.org>
Tue, 25 Aug 2009 09:30:42 +0000 (11:30 +0200)
committerMartin Willi <martin@strongswan.org>
Wed, 26 Aug 2009 09:23:55 +0000 (11:23 +0200)
scripts/key2keyid.c
scripts/keyid2sql.c

index 15d1323..3de69ff 100644 (file)
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
        chunk = chunk_create(buf, read);
        
        private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
-                                                                BUILD_BLOB_ASN1_DER, chunk_clone(chunk),
+                                                                BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                 BUILD_END);
        if (private)
        {
@@ -54,12 +54,12 @@ int main(int argc, char *argv[])
        }
        
        public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
-                                                               BUILD_BLOB_ASN1_DER, chunk_clone(chunk),
+                                                               BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                BUILD_END);
        if (!public)
        {
                public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_RSA,
-                                                                       BUILD_BLOB_ASN1_DER, chunk_clone(chunk),
+                                                                       BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                        BUILD_END);
        }
        if (public)
index 094e1af..25a29d6 100644 (file)
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
        chunk = chunk_create(buf, read);
        
        private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
-                                                                BUILD_BLOB_ASN1_DER, chunk_clone(chunk),
+                                                                BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                 BUILD_END);
        if (private)
        {
@@ -48,12 +48,12 @@ int main(int argc, char *argv[])
        }
        
        public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
-                                                               BUILD_BLOB_ASN1_DER, chunk_clone(chunk),
+                                                               BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                BUILD_END);
        if (!public)
        {
                public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_RSA,
-                                                                       BUILD_BLOB_ASN1_DER, chunk_clone(chunk),
+                                                                       BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                        BUILD_END);
        }
        if (public)