⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listcerts

📁 Perl写的CA认证程序
💻
字号:
## OpenCA - RA Server Command## (c) 1998-2001 by Massimiliano Pala and OpenCA Group####   File Name: certsList##       Brief: build Certificates' listing## Description: Build Certificates' listing given the dataType##  Parameters: dataType, viewFrom, rowsif ( $cmd !~ /listCerts/i ) {        configError( "Wrong Command Usage ($cmd/importReqs)!" );        exit 1;}## Reserved variablesmy ( $page, $certData, $sheet );## We need some parameters to generate the list because of## we do not want to generate a list of ALL issued certificates## so get the numer of results we should give away, then the## starting serial number.my $from     = $query->param( 'viewFrom' );my $matched  = $query->param( 'rows' );my $dataType = $query->param( 'dataType' );## if ( $cmd =~ /^validCerts/i ) {## 	$dataType = "VALID_CERTIFICATE";## } elsif ( $cmd =~ /^expiredCerts/i ) {##       $dataType = "EXPIRED_CERTIFICATE";##         } elsif ( $cmd =~ /^revokedCerts/i ) {##                 $dataType = "REVOKED_CERTIFICATE";##         } elsif ( $cmd =~ /^caCerts/i ) {##                 $dataType = "VALID_CA_CERTIFICATE";##         } elsif ( $cmd =~ /^expiredCaCerts/i ) {##                 $dataType = "EXPIRED_CA_CERTIFICATE";##         } elsif ( $cmd =~ /^allCerts/i ) {##                 ## A little tricky this pattern matching, isn't it ?##                 $dataType = '(?!CA).._CERTIFICATE';##         };## Get required parameters ( return only the value string )my $sheet    = getRequired( 'basecertslist' );my $maxItems = getRequired( 'MaxReturnedItems');my $uptime   = $tools->getDate();my @cols;## Get the base Page ( got in $page variable )if( not $page = $query->getFile( "$sheet" ) ) {	configError ( "File not Found : $sheet" );};## Set the column titlespush( @cols, "Serial" );push( @cols, "Common Name" );push( @cols, "Email" );if ( not $matched ) {	$matched  = $db->elements( DATATYPE=>$dataType );};my @certsList = $db->listItems( DATATYPE=>$dataType,			FROM=>$from, TO=>$to, ITEMS=>$maxItems );$table  = $query->buildRefs( ELEMENTS=>$matched, MAXITEMS=>$maxItems  );$table .= $query->startTable( 	COLS=>[ @cols ],				WIDTH=>"100%",				TITLE_BGCOLOR=>"#DDCCFF" );## Process all Filesforeach $cert ( @certsList ) {	my ( $format, $key, $type, $ser_col );	my @vals;	$key  = $cert->getParsed()->{DBKEY};	$type = $dataType;	$ser_col = "<a href=\"$self?cmd=viewCert&dataType=$type" .			"&key=$key\">".$cert->getParsed()->{SERIAL} ."</a>";	push( @vals, $ser_col );	push( @vals, ( $cert->getParsed()->{CN} || "<CENTER>---</CENTER>") );	push( @vals, ( $cert->getParsed()->{EMAIL} || "<CENTER>---</CENTER>") );	$table .= $query->addTableLine( DATA =>[ @vals ]);}## Close the Table$table .= $query->endTable();$table .= getCopyRight();## Substitute the Variables in the $page$page = $query->subVar( $page, '$uptime', $uptime );$page = $query->subVar( $page, '$table', $table );print "$page";1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -