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