使用openssl生成.p12文件时,直接在命令中带密码参数,而不用在终端运行命令时输入

来源:互联网 发布:七星彩规律软件 编辑:程序博客网 时间:2024/06/05 14:21

my $exp_pass      = "password";

my $cnf_file = $CONF_FILE_PATH."ssl_server_certificate.conf";

 #2k cert
$cmd         = "openssl req -config $cnf_file -new -x509 -sha256 -newkey rsa:2048"
                   ." -nodes -keyout $crt_path/server.key -days 365 -out $crt_path/server.crt";
$out         = $pc3_ssh->capture($cmd);;

#generate the pk12 file

$cmd         = "openssl pkcs12 -passout pass:\"$exp_pass\" -export -in $crt_path/server.crt "

                    ."-inkey $crt_path/server.key -out $crt_path/server.p12";

my $out      = $pc3_ssh->capture($cmd);



阅读全文
0 0
原创粉丝点击