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

📄 pki

📁 Perl写的CA认证程序
💻
字号:
#!/usr/bin/perl## RA Server Management Utility ## (c) 1999 by Massimiliano Pala## All Rights Reserved#### Project Information:#### 	Current Version ..................... $VER##      Project Started on .................. 17/12/1998##      Last Modified on .................... 09/09/2000##      Project Closed on ................... n/a#### Program currently tested with OpenLDAP v.1.2 on Linux, Solaris## and Sleepycat DB.#### 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##	m.pala@mo.nettuno.it##	digid@netscape.net#### Modified by Miguel Armas <kuko@ulpgc.es>##  - Added support for Latin1 names (Latin1 and .'-)##  - Some minor bugfixes##  - warnUsers and deleteFiles commands now works##  - CopyCerts didn't copy non-numeric certs (0A.pem)##  - Added certsList command (view issued certificates)##  - Added viewCert command (view certificate details)#### Modified by V韈tor R. Ruiz <rvr@ulpgc.es>##  - Minor changes in certsList command (table display and revokation command)##  - Added appRevReq command (approve revokation request)##  - Minor changes in parseCertificateFile (added issuer)##  - Added viewCRL command##  - minor changes in viewCert command (status)## 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;@INC = ( @INC, "lib/" );## Flush the output$|=1;## Version Releaselocal $VER = '0.2.01';local $PRG = 'PKI Public Server';## 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::Tools;use OpenCA::REQ;use OpenCA::PKCS7;## Standard Perl Moduleuse Cwd;## LDAP moduleuse Net::LDAP;## Functions Requirements## ======================require "misc-utils.lib";## 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 configuration$CONFIG = 'conf/public.conf';$DBCONFIG = 'conf/DB.conf';$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;}## Now it's time to get the parameters passed over the weblocal $query  = new OpenCA::TRIStateCGI;## Let's get the base Directorylocal ( $basedir ) = ( $ENV{'SCRIPT_FILENAME'} =~ /(.*)\/.*/ );local $self = $query->url(-query=>0,-full=>0); ## Init Section## ============local $shellPath = getRequired( 'openssl' );local $tmpdir    = getRequired( 'TempDir' );local $verify    = getRequired( 'VerifyPath' );local $sign      = getRequired( 'SignPath' );local $versions;local $cryptoShell = new OpenCA::OpenSSL( SHELL => "$shellPath" );if ( not $cryptoShell ) {	print "Content-type: text/html\n\n";	configError( "Cannot initialize Crypto Shell ($shellPath)!" );	exit 1;}$cryptoShell->setParams( CONFIG=>"$sslcnf",                         TMPDIR=>"$tmpdir",                         VERIFY=>"$verify",                         SIGN  =>"$sign", );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";}## Engine support of openssllocal $engine = getRequired( 'opensslEngine' );if( ($engine ne "") and ( $engine !~ /^no$/i ) ) {        $ENV{'engine'} = $engine;}$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## ============$cmd = $query->param('cmd');if ( "$cmd" eq "" ) {        my @cols;	my $i;        my @modules = ( OpenSSL, Tools, DB, Configuration, TRIStateCGI,                        REQ, X509, CRL, PKCS7 );        print "Content-type: text/html\n\n";        print $query->start_html(-title=>"OpenCA",                                        -BGCOLOR=>"#FFFFFF",                                        -TEXT=>"#445599" );        print "<CENTER>";        print "<FONT SIZE=\"+3\">";        print "<B>Open<FONT COLOR=\"#FF9900\">CA</FONT></B></FONT><BR>\n";        print "<FONT SIZE=\"+1\">";        print "($PRG Version $VER)</FONT><BR>\n";        print "<HR WIDTH=80%>";        push( @cols, "Module" );        push( @cols, "Version" );        print $query->startTable( COLS=>[ @cols ],                                     WIDTH=>"80%",                                     TABLE_BGCOLOR=>"#000000",                                     TITLE_BGCOLOR=>"#DDCCFF" );        foreach $i (@modules) {                print $query->addTableLine( DATA=>[                        $i, $versions->{$i} ],                        COLOR=>"#000000" );        }        print $query->endTable();        print closeLogPage();        exit;};## 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!";}

⌨️ 快捷键说明

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