aboutsummaryrefslogtreecommitdiff
path: root/openssl/trunk/demos/b64.pl
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2006-06-20 17:33:26 +0000
committerRob Austein <sra@hactrn.net>2006-06-20 17:33:26 +0000
commit52261db09ef9dbf5abc95baed22722c5c332f9f7 (patch)
tree05a8dc819a8d84717dfbffc287f45e6b19002984 /openssl/trunk/demos/b64.pl
parent8b319903618337c8bc643eb16454f59fabd2f28b (diff)
Pulling OpenSSL 0.9.8b into trunk
svn path=/openssl/trunk; revision=3
Diffstat (limited to 'openssl/trunk/demos/b64.pl')
-rw-r--r--openssl/trunk/demos/b64.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/openssl/trunk/demos/b64.pl b/openssl/trunk/demos/b64.pl
new file mode 100644
index 00000000..8aa5fb46
--- /dev/null
+++ b/openssl/trunk/demos/b64.pl
@@ -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";
+
+