Mark Overmeer > Net-Domain-TMCH-0.17 > Net::Domain::SMD

Download:
Net-Domain-TMCH-0.17.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.17   Source  

NAME ^

Net::Domain::SMD - info from one SMD structure

INHERITANCE ^

 Net::Domain::SMD is extended by
   Net::Domain::SMD::File

SYNOPSIS ^

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

  # Data::Dumper is your friend
  foreach my $court ($smd->courts)
  {   print $court->{courtName}, "\n";
      print Dumper $court;
  }

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

  foreach my $treaty ($smd->treaties) ...

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->fromNode(NODE, OPTIONS)

Input is an XML::LibXML::Element, which contains a signedMark structure. The OPTIONS are passed on to new().

 -Option --Default
  schemas  <required>
schemas => XML::Compile::Schema
Net::Domain::SMD->new(OPTIONS)
 -Option --Default
  data     <required>
  payload  <required>
data => HASH
payload => XML-NODE

Attributes

$obj->payload()

Returns the XML::LibXML::Element which contains the whole SMD structure.

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

Limit to the certificates of the issuer.

$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->from()

Returns the timestamp reflecting the 'notBefore' field, as string. When "auto_datetime" is enabled, this will return a DateTime object.

$obj->fromTime()

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

$obj->issuer()

Returns the issuer information, as a HASH.

$obj->smdID()
$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

$obj->until()

Returns the timestamp reflecting the 'notAfter' field, as string. When "auto_datetime" is enabled, this will return a DateTime object.

$obj->untilTime()

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

Helpers

$obj->date2time(STRING)
Net::Domain::SMD->date2time(STRING)

Converts a time string into a DateTime object. Accepted time-STRINGs are like time stamps in the SMD file headers, but also the ISO values inside an object.

SEE ALSO ^

This module is part of Net-Domain-TMCH distribution version 0.17, built on January 13, 2014. 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-2014 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

syntax highlighting: