]> WPIA git - cassiopeia.git/blobdiff - lib/openssl/demos/b64.pl
add: execute openssl fetcher to fetch openssl 1.0.1j
[cassiopeia.git] / lib / openssl / demos / b64.pl
diff --git a/lib/openssl/demos/b64.pl b/lib/openssl/demos/b64.pl
new file mode 100644 (file)
index 0000000..8aa5fb4
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/local/bin/perl
+
+#
+# Make PEM encoded data have lines of 64 bytes of data
+#
+
+while (<>)
+       {
+       if (/^-----BEGIN/ .. /^-----END/)
+               {
+               if (/^-----BEGIN/) { $first=$_; next; }
+               if (/^-----END/) { $last=$_; next; }
+               $out.=$_;
+               }
+       }
+$out =~ s/\s//g;
+$out =~ s/(.{64})/$1\n/g;
+print "$first$out\n$last\n";
+
+