📄 ca
字号:
#!/usr/bin/perl## Certification Authority (HTML Interface)## (c) 1999 by Massimiliano Pala and OpenCA Group## All Rights Reserved#### Project Information:#### Current Version ..................... $VER## Project Started on .................. 17/12/1998## Last Modified on .................... 01/06/1999## Project Closed on ................... n/a#### Program currently tested with Perl5 Linux, Solaris and Apache.#### DISC CLAIMER: THIS SOFTWARE IS GIVEN AS IS WITHOUT ANY WARRANTIES## ABOUT ANY DAMAGE DERIVED BY THE USE ( CORRECT OR NOT ) OF THIS## SOFTWARE. THE AUTHOR IS THEREFORE NOT RESPONSABLE IN ANY WAY OF## DAMAGES RELATED IN ANY WAY TO THIS OR SUPPORTED SOFTWARE AS WELL.#### 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:#### madwolf@comune.modena.it## madwolf@openca.org#### Modified by Miguel Armas <kuko@ulpgc.es>## - Added Latin1 name support (Latin1 and .-')#### Modified by V韈tor R. Ruiz <rvr@ulpgc.es>## - Added viewCRL command## - Added importCRR command## - Added pendingCRR command (createTable and addFile subroutines)## - Added viewPendingCRR command (viewPendingCRRequest subroutine)## - Added revokeCertificate command ## - Minor changes in ExportCRL## 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!## Base requirementsrequire 5.001;## Version Release$VER = '0.7.30';$PRG = 'CA Manager';## Add lib/ dir in includes list@INC = ( @INC, "lib" );## Modules to be installed to have this program to work properlyuse OpenCA::Configuration;use OpenCA::TRIStateCGI;## New OpenCA modulesuse OpenCA::OpenSSL;use OpenCA::X509;use OpenCA::CRL;use OpenCA::CRR;use OpenCA::Tools;use OpenCA::REQ;use OpenCA::PKCS7;## Functions Requirements## ======================require "crypto-utils.lib";require "misc-utils.lib";require "log-utils.lib";## require "solaris-utils.lib";## Now it's time to get the parameters passed over the weblocal $query = new OpenCA::TRIStateCGI;## Generate a new reference to Configuration ( instance )local $config = new OpenCA::Configuration;local $dbconfig = new OpenCA::Configuration;local $dbiconfig = new OpenCA::Configuration;## Let's load our default configurationlocal $CONFIG = 'conf/ca.conf';local $DBCONFIG = 'conf/DB.conf';local $DBICONFIG = 'conf/DBI.conf';if( ($ret = $config->loadCfg( "$CONFIG" )) == undef ) { print "Content-type: text/html\n\n"; configError( "Error while Loading Configuration ($CONFIG)!" ); exit 100;}## Flush the output$|=1;## Print the Content Type for Browserprint "Content-type: text/html\n\n";## Let's get the base Directorylocal ( $basedir ) = ( $ENV{'SCRIPT_FILENAME'} =~ /(.*)\/.*/ );local $self = $query->url(-query=>0,-full=>0); ## Init Section## ============## Engine support of openssllocal $engine = getRequired( 'opensslEngine' );if( ($engine ne "") and ( $engine !~ /^no$/i ) ) { $ENV{'engine'} = $engine;}## Get modules Versionslocal $shellPath = getRequired( 'openssl' );local $tmpdir = getRequired( 'TempDir' );local $sslcnf = getRequired( 'sslconfig' );local $verify = getRequired( 'VerifyPath' );local $sign = getRequired( 'SignPath' );local $versions = {};local $errno = 0;local $errval = "";local $cryptoShell = new OpenCA::OpenSSL( SHELL=>$shellPath );if ( not $cryptoShell ) { configError( "Cannot initialize Crypto Shell ($shellPath)!" ); exit 1;}$cryptoShell->setParams( SHELL =>"$shellPath", CONFIG=>"$sslcnf", TMPDIR=>"$tmpdir", VERIFY=>"$verify", SIGN =>"$sign", ); #### STDERR=>"/dev/null" );local $tools = new OpenCA::Tools();if ( not $tools ) { configError( "Cannot initialize OpenCA::Tools class!" ); exit 1;}local $db;if ( uc getRequired ('DBmodule') eq "DBI") { require "initDBI";} else { require "initDB";}$versions->{OpenSSL} = OpenCA::OpenSSL->VERSION;$versions->{Tools} = OpenCA::Tools->VERSION;$versions->{Configuration} = OpenCA::Configuration->VERSION;$versions->{TRIStateCGI} = OpenCA::TRIStateCGI->VERSION;$versions->{REQ} = OpenCA::REQ->VERSION;$versions->{X509} = OpenCA::X509->VERSION;$versions->{CRL} = OpenCA::CRL->VERSION;$versions->{PKCS7} = OpenCA::PKCS7->VERSION;## Main Section## ============local $cmd = ( $query->param('cmd') or "caInfo");## Let's get the commands directly from the cmds/ directory.## The require will load and execute itif( -e "cmds/$cmd" ) { require "cmds/$cmd"; exit $?;} else { ## No Valid Command has been given if you reach this point generalError( "Command $cmd Not Supported ( yet ?!? )." ); die "Cannot Find $cmd Command!";}exit 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -