version 1.6, 2015/08/22 16:36:05 |
version 1.7, 2015/09/11 14:30:23 |
|
|
#include <openssl/pem.h> |
#include <openssl/pem.h> |
|
|
struct { |
struct { |
#ifndef OPENSSL_NO_ENGINE |
|
char *engine; |
|
#endif |
|
char *infile; |
char *infile; |
int noout; |
int noout; |
char *outfile; |
char *outfile; |
|
|
} pkeyparam_config; |
} pkeyparam_config; |
|
|
struct option pkeyparam_options[] = { |
struct option pkeyparam_options[] = { |
#ifndef OPENSSL_NO_ENGINE |
|
{ |
{ |
.name = "engine", |
|
.argname = "id", |
|
.desc = "Use the engine specified by the given identifier", |
|
.type = OPTION_ARG, |
|
.opt.arg = &pkeyparam_config.engine, |
|
}, |
|
#endif |
|
{ |
|
.name = "in", |
.name = "in", |
.argname = "file", |
.argname = "file", |
.desc = "Input file (default stdin)", |
.desc = "Input file (default stdin)", |
|
|
pkeyparam_usage() |
pkeyparam_usage() |
{ |
{ |
fprintf(stderr, |
fprintf(stderr, |
"usage: pkeyparam [-engine id] [-in file] [-noout] [-out file] " |
"usage: pkeyparam [-in file] [-noout] [-out file] " |
"[-text]\n"); |
"[-text]\n"); |
options_usage(pkeyparam_options); |
options_usage(pkeyparam_options); |
} |
} |
|
|
pkeyparam_usage(); |
pkeyparam_usage(); |
return (1); |
return (1); |
} |
} |
|
|
#ifndef OPENSSL_NO_ENGINE |
|
setup_engine(bio_err, pkeyparam_config.engine, 0); |
|
#endif |
|
|
|
if (pkeyparam_config.infile) { |
if (pkeyparam_config.infile) { |
if (!(in = BIO_new_file(pkeyparam_config.infile, "r"))) { |
if (!(in = BIO_new_file(pkeyparam_config.infile, "r"))) { |