📄 gencrl
字号:
## OpenCA - CA Command## (c) 1998-2001 by Massimiliano Pala and OpenCA Group#### File Name: genCRL## Brief: Issue a CRL## Description: Issue a new CRL## Parameters: passwd## Cfg KeyWord: CreateArchive,TestArchive,ExportDev,OpenCADir,TempDirmy $cmdName = "genCRL";if ( $cmd !~ /$cmdName/i ) { configError( "Wrong Command Usage ($cmd over $cmdName)!" ); exit 1;}## This function exports the CRL in DER format (preferred## to the default PEM format for its smaller size: CRL## can get very long in a medium CAs' life cycle). ## Get required parameters from the configuration filemy $arch = getRequired( 'CreateArchive' );my $test = getRequired( 'TestArchive' );my $dest = getRequired( 'ExportDev' );my $opencaDir = getRequired( 'OpenCADir' );my $dir = getRequired( 'TempDir' ); my $pwd = $query->param( 'passwd' );my $days = $query->param( 'days' );my $exts = $query->param( 'exts' ); ## Build the right $cmd with substitution of the $dest## with the 'ExportDest' and in 'TestArchive'$arch = $query->subVar( $arch, '$dest', $dest );$test = $query->subVar( $test, '$dest', $dest ); print startLogPage("CRL Issuing");print addLogSection("Generating Certificate Revocation List ... ");## Generate a new CRL objectmy $CRL = new OpenCA::CRL ( SHELL=>$cryptoShell, CACERT=>"$opencaDir/stuff/cacert.pem", CAKEY=>"$opencaDir/private/cakey.pem", DAYS=>$days, EXTS=>$exts, PASSWD=>"$pwd" );if ( not $CRL ) { print addErrorLog("ERROR: Cannot initialize a new CRL Object!"); print addPreLogLine( $CRL ); closePage(); exit 0;}$ret = $CRL->getTXT();print addLogLine("Ok.");print addPreLogLine( $ret );print closeLogSection();print addLogSection("Saving CRL to PEM format ... ");if ( open( FD, ">$opencaDir/outbound/crl/${$}_cacrl.pem" ) ) { print FD $CRL->getPEM(); close(FD);} else { print addErrorLog("CRL saving Error (outbound/crl/${$}_cacrl.pem"); print addPreLogLine("$!"); closePage(); exit 0;}print addLogLine("Ok.");print addPreLogLine("$opencaDir/outbound/crl/${$}_cacrl.pem");print closeLogSection();print addLogSection("Importing CRL to dB ... ");if( not $db->storeItem( DATATYPE=>VALID_CRL, OBJECT=>$CRL )) { print addErrorLog("DB Error while importing!"); closePage(); exit 0;}print addLogLine("Ok.");print closeLogSection();closePage();1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -