我有客户端服务器架构的应用程序。
客户机(C程序):
服务器(Perl脚本):
DER
我的问题是如何将各种PEM数据转换为perl中的DER/BER (二进制数据)?
发布于 2010-08-10 05:31:24
发布于 2016-11-16 21:18:42
基于已接受的答案的一个例子:
#!/usr/bin/perl
use strict;
use warnings;
use MIME::Base64;
my $certPath = 'cert.pem';
open my $fh, '<', $certPath or die(sprintf('Could not open %s file: %s', $certPath, $!));
my $derBlob = do { local $/; decode_base64(<$fh> =~ s/^-.*?\n//gmr); };
close($fh);
print $derBlob;
1;
__END__
https://stackoverflow.com/questions/3449396
复制