NAME

Net::Domain::SMD::File - Info from one SMD file

SYNOPSIS

# end-user route to collect the info
my $tmch  = Net::Domain::TMCH->new(%options);
my $smdf  = $tmch->smd($filename);

# use by TMCH internally
my $smd  = Net::Domain::SMD->new(%options);
my $smdf = $smd->read($fn);

DESCRIPTION

Draft RFC http://tools.ietf.org/html/draft-lozano-tmch-func-spec-06 SMD information is packaged. This object represents one file in wrapped format.

METHODS

Constructors

Net::Domain::SMD::File->fromFile(FILENAME, OPTIONS)
-Option --Default
 schemas  <required>
schemas => SCHEMAS
Net::Domain::SMD::File->new(OPTIONS)
-Option  --Default
 filename  <required>
filename => FILENAME

Attributes

$obj->filename()
$obj->labels()

Returns a list of u-labels.

$obj->marks()

Returns the marks named in the "Marks" field. The name insinuates that this field may contains multiple values, but the format of this field is not described in the spec.

$obj->payload()

Returns the XML::LibXML::Document contained in the file.

File header access

The SMD-file contains a header, wrapping the XML content. The next methods provide access to that header information.

$obj->from()

Returns the timestamp reflecting the 'notBefore' field.

$obj->fromTime()

The value of from() converted into seconds from epoc.

$obj->smdID()
$obj->until()

Returns the timestamp reflecting the 'notAfter' field.

$obj->untilTime()

The value of until() converted into seconds from epoc.

XML content access

The following methods try to be smart, to hide complexities in the XML structure, simplifying the main program.

$obj->certificates(OPTIONS)

Returns the certificates as contained in the SMD file.

-Option--Default
 issuer  <any issuer>
issuer => NAME
$obj->courts()

Returns a list of HASHes, each representing one court. See examples/mark-templ.pl

example:

foreach my $court ($smd->courts)
{   print $court->{courtName}, "\n";
    print Dumper $court;
}
$obj->trademarks()

Returns a list of HASHes, each representing one trademark. See examples/mark-templ.pl

example:

foreach my $trademark ($smd->trademarks)
{   print $trademark->{markName}, "\n";
    my $holders = $trademark->{holder} || [];
    foreach my $holder (@$holders)
    {  print "Holder: $holder->{name}\n";
    }
}
$obj->treaties()

Returns a list of HASHes, each representing one treaty or statute (one element of type "treatyOrStatute". See examples/mark-templ.pl

Helpers

$obj->date2time(STRING)

Converts a time string into a time stamp (since epoch).

SEE ALSO

This module is part of Net-Domain-TMCH distribution version 0.12, built on October 14, 2013. Development was supported by NIC.at, the Austrian Domainname Registry.

Website: F<http://perl.overmeer.net/net-domain-tmch/>

The documentation and interface style is consistent with a large set of modules, belonging to the XML::Compile suite.

LICENSE

Copyrights 2013 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html