Add PKCS#8 utility functions and add PBE options.
[openssl.git] / apps / pkcs8.c
index a05388300ad6128b198be7763236f3f6f51a81f7..8ac9e1238df5a62002d4fbf1e4368379d7fe84f3 100644 (file)
@@ -99,6 +99,16 @@ int MAIN(int argc, char **argv)
                                        badarg = 1;
                                }
                        } else badarg = 1;
                                        badarg = 1;
                                }
                        } else badarg = 1;
+               } else if (!strcmp(*args,"-v1")) {
+                       if (args[1]) {
+                               args++;
+                               pbe_nid=OBJ_txt2nid(*args);
+                               if(pbe_nid == NID_undef) {
+                                       BIO_printf(bio_err,
+                                                "Unknown PBE algorithm %s\n", *args);
+                                       badarg = 1;
+                               }
+                       } else badarg = 1;
                } else if (!strcmp(*args,"-inform")) {
                        if (args[1]) {
                                args++;
                } else if (!strcmp(*args,"-inform")) {
                        if (args[1]) {
                                args++;
@@ -139,6 +149,7 @@ int MAIN(int argc, char **argv)
                BIO_printf (bio_err, "-noiter    use 1 as iteration count\n");
                BIO_printf (bio_err, "-nocrypt   use or expect unencrypted private key\n");
                BIO_printf (bio_err, "-v2 alg    use PKCS#5 v2.0 and cipher \"alg\"\n");
                BIO_printf (bio_err, "-noiter    use 1 as iteration count\n");
                BIO_printf (bio_err, "-nocrypt   use or expect unencrypted private key\n");
                BIO_printf (bio_err, "-v2 alg    use PKCS#5 v2.0 and cipher \"alg\"\n");
+               BIO_printf (bio_err, "-v1 obj    use PKCS#5 v1.5 and cipher \"alg\"\n");
                return (1);
        }
 
                return (1);
        }