]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - crypto/openssl/demos/b64.pl
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / crypto / openssl / demos / b64.pl
1 #!/usr/local/bin/perl
2
3 #
4 # Make PEM encoded data have lines of 64 bytes of data
5 #
6
7 while (<>)
8         {
9         if (/^-----BEGIN/ .. /^-----END/)
10                 {
11                 if (/^-----BEGIN/) { $first=$_; next; }
12                 if (/^-----END/) { $last=$_; next; }
13                 $out.=$_;
14                 }
15         }
16 $out =~ s/\s//g;
17 $out =~ s/(.{64})/$1\n/g;
18 print "$first$out\n$last\n";
19
20