Cover V08, I02
Article
Figure 1a
Figure 1b
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Listing 1
Listing 2
Listing 3
Listing 4
Listing 5

feb99.tar


Listing 2: Perl program to install CA ROOT certificate

#!/usr/local/bin/perl

$CAROOT="demoCA";

$cert = "$CAROOT/cacert.pem";

open CERT, "<$cert" or die "certificate: $!\n";
@full = <CERT>;
close CERT;

$size = 0;
shift @full until( $full[0] =~ /-----BEGIN CERTIFICATE-----/ );
shift @full;
push @cert, shift @full until( ($size += (length( $cert[$#cert]) )) \
&& $full[0] =~ /-----END CERTIFICATE-----/ ); $size += length( "-----BEGIN CERTIFICATE-----\n" ); $size += length( "-----END CERTIFICATE-----\n" ); print "HTTP/1.0 200 \n"; print "Content-Type: application/x-x509-ca-cert\n"; print "Content-Encoding: base64\n"; print "Content-Length: " . $size . "\n\n"; print "-----BEGIN CERTIFICATE-----\n"; foreach (@cert) { chomp; print"$_\n"; } print "-----END CERTIFICATE-----\n"; # End of File