aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dsa.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2005-10-08 17:32:07 +0000
committerDr. Stephen Henson <steve@openssl.org>2005-10-08 17:32:07 +0000
commit3f67e11fabc8e02cfe2bd5b53c1cc0e8126cf31b (patch)
treeac919af701e84c6fbc0a89ac0d3d20c5020bb437 /apps/dsa.c
parentc1de1a190d59260633d330e3bb2471f06a17d8d9 (diff)
downloadopenssl-3f67e11fabc8e02cfe2bd5b53c1cc0e8126cf31b.tar.gz
Add PVK support to dsa utility.
Diffstat (limited to 'apps/dsa.c')
-rw-r--r--apps/dsa.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/dsa.c b/apps/dsa.c
index 290f597b58..091f936571 100644
--- a/apps/dsa.c
+++ b/apps/dsa.c
@@ -110,6 +110,8 @@ int MAIN(int argc, char **argv)
char *passin = NULL, *passout = NULL;
int modulus=0;
+ int pvk_encr = 2;
+
apps_startup();
if (bio_err == NULL)
@@ -169,6 +171,12 @@ int MAIN(int argc, char **argv)
engine= *(++argv);
}
#endif
+ else if (strcmp(*argv,"-pvk-strong") == 0)
+ pvk_encr=2;
+ else if (strcmp(*argv,"-pvk-weak") == 0)
+ pvk_encr=1;
+ else if (strcmp(*argv,"-pvk-none") == 0)
+ pvk_encr=0;
else if (strcmp(*argv,"-noout") == 0)
noout=1;
else if (strcmp(*argv,"-text") == 0)
@@ -317,11 +325,13 @@ bad:
i=PEM_write_bio_DSA_PUBKEY(out,dsa);
else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
NULL,0,NULL, passout);
- } else if (outformat == FORMAT_MSBLOB) {
+ } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
EVP_PKEY *pk;
pk = EVP_PKEY_new();
EVP_PKEY_set1_DSA(pk, dsa);
- if (pubin || pubout)
+ if (outformat == FORMAT_PVK)
+ i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
+ else if (pubin || pubout)
i = i2b_PublicKey_bio(out, pk);
else
i = i2b_PrivateKey_bio(out, pk);