📄 exportcrl
字号:
## OpenCA - CA Command## (c) 1998-2001 by Massimiliano Pala and OpenCA Group#### File Name: exportCRL## Brief: Exports CRLs## Description: Exports on a removable media newly issued CRLs## Parameters: passwdmy $cmdName = "exportCRL";my @clrList;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' ); ## 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 Exporting");print addLogSection("CRL Exporting ($dest) ... ");if( not chdir( "$opencaDir/outbound/crl/" )) { addErrorLog( "Failed changing dir to $dir." ); closePage(); exit 1;}opendir( CRLs, "$opencaDir/outbound/crl/" ) or die "Cannot access dir '$opencaDir/outbound/crl/'"; @crlList = grep( /cacrl/, readdir( CRLs ));closedir( CRLs );if( $#crlList < 0 ) { print addLogLine( "Ok." ); print addLogLine("<I><OL>No CRLs to be exported.</OL></I>"); print closeLogSection(); closePage(); exit;}$ret = `$arch *cacrl* 2>&1`;if( $? != 0 ) { print addErrorLog("Archiving Failed on $dest!", "$ret"); closePage(); exit 0;}print addLogLine("Ok.");print addPreLogLine("$ret");print closeLogSection();print addLogSection("Testing Created Archive ... ");$ret = `$test 2>&1`;if( $? != 0 ) { print addErrorLog("Check Failed on $dev!\n"); closePage(); exit;}print addLogLine("Ok.");print addPreLogLine("$ret");print closeLogSection(); print addLogSection("Removing Temp Files ... ");$tools->deleteFiles( DIR=>"$opencaDir/outbound/crl", FILTER=>'*cacrl*' );if( $? != 0 ) { print addErrorLog("Failed!"); closePage(); exit 0;}print addLogLine("Ok.");print addPreLogLine("$ret");print closeLogSection();closePage();1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -