Initial Commit
This commit is contained in:
20
openssl-1.0.2f/demos/b64.pl
Normal file
20
openssl-1.0.2f/demos/b64.pl
Normal file
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user