📄 submit_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: submit_ask4rev## Brief: submit the CRR## Description: submit the CRR finally## Parameters: if ( $cmd !~ /submit_ask4rev/i ) { configError( "Wrong Command Usage ($cmd over submit_ask4rev)!" ); exit 1;}## Print the Content Type for Browserprint "Content-type: text/html\n\n";## Main Section## ============my $dir = 'RevReqDir';my $successPage = getRequired('RevSuccessPage');my $errorPage = getRequired('RevErrorPage');my $cachain = getRequired ('CAChain');# Read query parametersmy $signature = $query->param('signature'); my $text = $query->param('text'); # 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); $pending_crr = $text."-----BEGIN PKCS7-----\n".$signature."\n-----END PKCS7-----\n";my $sign = new OpenCA::PKCS7( SHELL => $cryptoShell, INFILE => "$signaturefile", DATAFILE => "$textfile", CA_DIR => "$cachain" ); my $info = $sign->verifyChain();unlink $textfile;unlink $signaturefile;if( $? != 0 ) { open ( FD, "$errorPage" ) || die ( "File not Found : $errorPage" ); while( $temp = <FD> ) { $page .= $temp; }; close ( FD ); print "$page"; exit 0;} else { my $crr = new OpenCA::CRR ( SHELL => $cryptoShell, DATA => $pending_crr ); print "Cannot create OpenCA::CRR object<br>\n" if (not $crr); print "Cannot store CRR in database<br>\n" if ( not $db->storeItem ( DATATYPE => "PENDING_CRR", MODE=>"INSERT", OBJECT=>$crr)); # All went OK, send success page open ( FD, "$successPage" ) || die ( "File not Found : $successPage" ); while( $temp = <FD> ) { $page .= $temp; }; close ( FD ); print "$page"; exit 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -