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

📄 show_ask4rev

📁 Perl写的CA认证程序
💻
字号:
#!/usr/bin/perl## Certificate Revocation Request## (c) 1999 by The OpenCA Team## All Rights Reserved#### Project Information:#### 	Current Version ..................... $ver: 0.031##      Project Started on .................. 15/02/2000##      Last Modified on .................... 19/02/2000##      Project Closed on ................... n/a#### Original program by Miguel Armas <kuko@openca.org>. Modified for## new release by Massimiliano Pala <madwolf@openca.org>.## If you want to contact me (the author) please use the e-mail## addresses listed below. Do not esitate in reporting bugs, enhancement## or anything seems useful in developing this software:####	Miguel Armas <kuko@ulpgc.es>#### Thank you for using this software, and remember that Open Projects## are the future of mankind. Do not sleep, partecipate to world wide## efforts to make life easier for all!## OpenCA - RA Server Command## (c) 1998-2001 by OpenCA Group####   File Name: show_ask4rev##       Brief: show the certificate which should be revoked## Description: ask for a second ok before revoking the certificate##  Parameters:if ( $cmd !~ /show_ask4rev/i ) {        configError( "Wrong Command Usage ($cmd over show_ask4rev)!" );        exit 1;}## Print the Content Type for Browserprint "Content-type: text/html\n\n";my $key = $query->param ( 'key' );$crr = $db->getItem ( DATATYPE => "PENDING_CRR", KEY => $key );# Read query parametersmy $signature = $crr->getParsed ()->{SIGNATURE}; my $text  = $crr->getParsed ()->{BODY}; my $cachain    = getRequired ('CAChain');print "SIGN: $signature\n";print "TEXT: $text\n";## Request Operation...## Get request form$page = $query->getFile ( getRequired ('ShowAsk4RevSheet') );# Now write text and signature to temp file (to verify signature)$textfile="/tmp/signtext.$$";$signaturefile="/tmp/signature.$$"; open(TXT,">$textfile") or die("Can't open $textfile: $!\n");open(SIGN,">$signaturefile") or die("Can't open $signaturefile: $!\n"); print TXT $text;## print SIGN "-----BEGIN PKCS7-----\n";print SIGN $signature;## print SIGN "\n-----END PKCS7-----\n"; close(TXT);close(SIGN); my $sign = new OpenCA::PKCS7( SHELL    =>  $cryptoShell,                              INFILE   => "$signaturefile",                              DATAFILE => "$textfile",                              CA_DIR   => "$cachain" ); my $info = $sign->verifyChain();if( $? != 0 ) {  $signout = "Couldn't verify the signature";} else {  $signout = "Signature correctly verified";} unlink $textfile;unlink $signaturefile; my $table = $query->startTable( COLS => [ "NAME", "VALUE" ],                             WIDTH => "100%",                             TITLE_BGCOLOR=>"#DDCCFF" );# Add relevant Variables...$table .= $query->addTableLine ( DATA => [ "Verification:", $signout ] );$table .= $query->addTableLine ( DATA => ["Subject:",    $info->{0}->{CN}        ]);$table .= $query->addTableLine ( DATA => ["E-Mail:",     $info->{0}->{Email}     ]);$table .= $query->addTableLine ( DATA => ["DN:",         $info->{0}->{DN}        ]);$table .= $query->addTableLine ( DATA => ["Issued by:",  $info->{1}->{DN}        ]);$table .= $query->addTableLine ( DATA => ["Not Before:", $info->{0}->{NOTBEFORE} ]);$table .= $query->addTableLine ( DATA => ["Not After:",  $info->{0}->{NOTAFTER}  ]);$table .= $query->addTableLine ( DATA => ["Serial:",     $info->{0}->{SERIAL}    ]);# Text to sign$text  = "-----BEGIN CRR-----\n";$text .= "Subject: $info->{0}->{CN} \n";$text .= "E-Mail: $info->{0}->{Email} \n";$text .= "DN: $info->{0}->{DN} \n";$text .= "Issued by: $info->{1}->{DN} \n";$text .= "Not Before: $info->{0}->{NOTBEFORE} \n";$text .= "Not After: $info->{0}->{NOTAFTER} \n";$text .= "Serial: $info->{0}->{SERIAL} \n";$text .= "-----END CRR-----\n";## Close the Table$table .= $query->endTable ();$table .= getCopyRight ();## Substitute the Variables in the $page$page = $query->subVar( $page, '$table', $table );$page = $query->subVar( $page, '$key', $key );$page = $query->subVar( $page, '$text', $text );$page = $query->subVar( $page, '$subject', $info->{0}->{DN});print "$page";exit 0;

⌨️ 快捷键说明

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