使用openssl生成.p12文件時,直接在命令中帶密碼參數,而不用在終端運行命令時輸入

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);



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章