# $Id$
#
# Test of XML::Simple as a tool for encoding and decoding
#
# http://mirin.apnic.net/resourcecerts/wiki/index.php/IR-ISP_Definition
# CMS wrapper for this (not yet written) would look something like:
#
# openssl smime -sign -nodetach -outform DER -in foo.xml -out foo.cms \
# -signer foo.cer -inkey foo.key
#
# openssl smime -verify -CApath . -inform DER -in foo.cms -out foo.xml
eval 'exec perl -w -S $0 ${1+"$@"}'
if 0;
use strict;
use XML::Simple;
use Data::Dumper;
my @xml = ('
','
','
[Certificate request]
','
[certificate]
','
','
','
[Readable text]
');
my $xs = XML::Simple->new(KeepRoot => 1, Forcearray => [qw(list_class)]);
for my $xml (@xml) {
my $x = $xs->XMLin($xml);
my $t = $xs->XMLout($x);
print("\n###\n", $xml, "\n", Dumper($x), "\n", $t);
}