?? show_ask4rev
字號:
#!/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 - Public Web-Gateway 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";# Read query parametersmy $signature = $query->param('signature'); my $text = $query->param('text'); my $cachain = getRequired ('CAChain');## 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, '$text', $text );$page = $query->subVar( $page, '$subject', $info->{0}->{DN});print "$page";exit 0;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -