📄 genskey
字号:
## OpenCA - CA Command## (c) 1998-2001 by Massimiliano Pala and OpenCA Group#### File Name: genSKey## Brief: Generate CA's Secret Key## Description: Generate The Secrete Key to be used by the CA## Parameters: bits, alg, passwdmy $cmdName = "genSKey";if ( $cmd !~ /$cmdName/i ) { configError( "Wrong Command Usage ($cmd over $cmdName)!" ); exit 1;}## This command will generate the new CA secret## key (private/cakey.pem)my $opencaDir = getRequired( 'opencadir' );my $baseDoc = getRequired( 'genskeysheet');## Get the parametersmy $bits = $query->param('bits');my $alg = $query->param('alg');my $pwd = $query->param('passwd');my $cakeyFile = "$opencaDir/private/cakey.pem";## Other reserved variablesmy ( $page, $key, $msg );if( -e "$cakeyFile" ) { $tools->moveFiles( SRC=>"$cakeyFile", DEST=>"${cakeyFile}_${$}.old" ); $msg = "Old key file is (${cakeyFile}_${$}.old)";}if( not $cryptoShell->genKey( BITS=>$bits, OUTFILE=>$cakeyFile, ALGORITHM=>$alg, PASSWD=>$pwd ) ) { $msg .= "<BR><BR>ERROR: Please check the web error log file (ERROR: $?)<BR>"; $msg .= "<FONT SIZE=-1 COLOR=\"#336699\">($cmd)</FONT>\n";}## Try loading the Key File$key = $tools->getFile( "$cakeyFile" );if( $key eq "" ) { configError( "Error loading generated Key!" );}## If we cannot load the base Document, then errorconfigError("Cannot load $baseDoc.") unless ( $page = $query->getFile("$baseDoc"));## Substitute the variables$page = $query->subVar( $page, '$key', $key );$page = $query->subVar( $page, '$msg', $msg );## Send out the pageprint "$page";1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -