Add 'rsautl' low level RSA utility.
[openssl.git] / apps / ca.c
index d28cde9..0931401 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -216,7 +216,7 @@ int MAIN(int, char **);
 
 int MAIN(int argc, char **argv)
        {
-       char *key=NULL;
+       char *key=NULL,*passargin=NULL;
        int total=0;
        int total_done=0;
        int badops=0;
@@ -333,6 +333,11 @@ EF_ALIGNMENT=0;
                        if (--argc < 1) goto bad;
                        keyfile= *(++argv);
                        }
+               else if (strcmp(*argv,"-passin") == 0)
+                       {
+                       if (--argc < 1) goto bad;
+                       passargin= *(++argv);
+                       }
                else if (strcmp(*argv,"-key") == 0)
                        {
                        if (--argc < 1) goto bad;
@@ -526,6 +531,11 @@ bad:
                lookup_fail(section,ENV_PRIVATE_KEY);
                goto err;
                }
+       if(!key && !app_passwd(bio_err, passargin, NULL, &key, NULL))
+               {
+               BIO_printf(bio_err,"Error getting password\n");
+               goto err;
+               }
        if (BIO_read_filename(in,keyfile) <= 0)
                {
                perror(keyfile);