Warning, /frameworks/kdelibs4support/src/kssl/kssl/cert_bundle is written in an unsupported language. File is not indexed.

0001 :
0002 eval 'exec perl -S $0 ${1+"$@"}'
0003     if $running_under_some_shell;
0004 
0005 ##
0006 ##  cert_bundle -- Bundle CA Certificates into one file
0007 ##  Copyright (c) 1998 Ralf S. Engelschall, All Rights Reserved. 
0008 ##
0009 
0010 ($certdb, $indexfile, $bundlefile) = @ARGV;
0011 
0012 %CERT = ();
0013 open(IDX, "<$indexfile") || die;
0014 while (<IDX>) {
0015     if (m|^(\S+):\s+(.+)\s*$|) {
0016         $CERT{$2} = $1;
0017     }
0018 }
0019 close(IDX);
0020 
0021 $date = `date`;
0022 $date =~ s|\n$||;
0023 open(BDL, ">$bundlefile") || die;
0024 print BDL "##\n";
0025 print BDL "##  $bundlefile -- Bundle of CA Certificates\n";
0026 print BDL "##  Last Modified: $date\n";
0027 print BDL "##\n";
0028 print BDL "##  This is a bundle of X.509 certificates of public\n";
0029 print BDL "##  Certificate Authorities (CA). These were automatically\n";
0030 print BDL "##  extracted from Netscape Communicator's certificate database\n";
0031 print BDL "##  (the file `$certdb').\n";
0032 print BDL "##\n";
0033 foreach $cert (sort(keys(%CERT))) {
0034     $file = $CERT{$cert};
0035         print STDERR "Bundling: $cert ($file)\n";
0036     $pem = `openssl x509 -in $file -inform DER -outform PEM`;
0037     $pem =~ s|\n$||;
0038     $purpose = `openssl x509 -in $file -inform DER -noout -purpose`;
0039     #
0040     $_ = $purpose;
0041     if ( /server CA : Yes\n/ || /client CA : Yes\n/ || (/Any Purpose CA : Yes\n/ && (/client : Yes\n/ || /server : Yes\n/ ))) {
0042        print BDL "\n";
0043        print BDL "$pem\n";
0044     }
0045 }
0046 close(BDL);
0047