diff options
author | Richard Levitte <levitte@openssl.org> | 2000-10-28 22:40:40 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-10-28 22:40:40 +0000 |
commit | 32d862ede4540acfdc8fe7f56bf583f7a2be3dbb (patch) | |
tree | dfe7455ed8f0d32e9c171f76122643cbb6b8dc58 /apps/apps.c | |
parent | a44f26d5c90c068e585faffeebe10cc9c51b9e78 (diff) |
Add the possibility to use keys handled by engines in more
applications.
Diffstat (limited to 'apps/apps.c')
-rw-r--r-- | apps/apps.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/apps/apps.c b/apps/apps.c index 0190d71ee2..a04f871d0a 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -553,7 +553,7 @@ end: return(x); } -EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass) +EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e) { BIO *key=NULL; EVP_PKEY *pkey=NULL; @@ -563,6 +563,14 @@ EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass) BIO_printf(err,"no keyfile specified\n"); goto end; } + if (format == FORMAT_ENGINE) + { + if (!e) + BIO_printf(bio_err,"no engine specified\n"); + else + pkey = ENGINE_load_private_key(e, file, pass); + goto end; + } key=BIO_new(BIO_s_file()); if (key == NULL) { @@ -602,7 +610,7 @@ EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass) return(pkey); } -EVP_PKEY *load_pubkey(BIO *err, char *file, int format) +EVP_PKEY *load_pubkey(BIO *err, char *file, int format, ENGINE *e) { BIO *key=NULL; EVP_PKEY *pkey=NULL; @@ -612,6 +620,14 @@ EVP_PKEY *load_pubkey(BIO *err, char *file, int format) BIO_printf(err,"no keyfile specified\n"); goto end; } + if (format == FORMAT_ENGINE) + { + if (!e) + BIO_printf(bio_err,"no engine specified\n"); + else + pkey = ENGINE_load_public_key(e, file, NULL); + goto end; + } key=BIO_new(BIO_s_file()); if (key == NULL) { |