diff options
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r-- | apps/pkcs12.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 90abbb84d2..f277956cd9 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -99,6 +99,7 @@ int MAIN(int argc, char **argv) BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL; char **args; char *name = NULL; + char *csp_name = NULL; PKCS12 *p12 = NULL; char pass[50], macpass[50]; int export_cert = 0; @@ -197,6 +198,11 @@ int MAIN(int argc, char **argv) args++; name = *args; } else badarg = 1; + } else if (!strcmp (*args, "-CSP")) { + if (args[1]) { + args++; + csp_name = *args; + } else badarg = 1; } else if (!strcmp (*args, "-caname")) { if (args[1]) { args++; @@ -572,6 +578,7 @@ int MAIN(int argc, char **argv) PKCS8_PRIV_KEY_INFO_free(p8); p8 = NULL; if (name) PKCS12_add_friendlyname (bag, name, -1); + if(csp_name) PKCS12_add_CSPName_asc(bag, csp_name, -1); PKCS12_add_localkeyid (bag, keyid, keyidlen); bags = sk_PKCS12_SAFEBAG_new_null(); sk_PKCS12_SAFEBAG_push (bags, bag); |