File Coverage

blib/lib/STIX/Observable/Extension/PDF.pm
Criterion Covered Total %
statement 26 26 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod n/a
total 35 35 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::Extension::PDF;
2              
3 24     24   539 use 5.010001;
  24         107  
4 24     24   152 use strict;
  24         52  
  24         728  
5 24     24   200 use warnings;
  24         75  
  24         1331  
6 24     24   166 use utf8;
  24         54  
  24         216  
7              
8 24     24   1342 use Types::Standard qw(Str Num Bool HashRef);
  24         58  
  24         219  
9              
10 24     24   91959 use Moo;
  24         70  
  24         196  
11 24     24   11548 use namespace::autoclean;
  24         80  
  24         252  
12              
13             extends 'STIX::Object';
14              
15 24         2369 use constant PROPERTIES => (qw[
16             version
17             is_optimized
18             document_info_dict
19             pdfid0
20             pdfid1
21 24     24   2732 ]);
  24         63  
22              
23 24     24   174 use constant EXTENSION_TYPE => 'pdf-ext';
  24         1221  
  24         4174  
24              
25             has version => (is => 'rw', isa => Num);
26             has is_optimized => (is => 'rw', isa => Bool);
27             has document_info_dict => (is => 'rw', isa => HashRef);
28             has pdfid0 => (is => 'rw', isa => Str);
29             has pdfid1 => (is => 'rw', isa => Str);
30              
31             1;
32              
33             =encoding utf-8
34              
35             =head1 NAME
36              
37             STIX::Observable::Extension::PDF - STIX Cyber-observable Object (SCO) - PDF File Extension
38              
39             =head1 SYNOPSIS
40              
41             use STIX::Observable::Extension::PDF;
42              
43             my $pdf_ext = STIX::Observable::Extension::PDF->new();
44              
45              
46             =head1 DESCRIPTION
47              
48             The PDF file extension specifies a default extension for capturing properties
49             specific to PDF files.
50              
51              
52             =head2 METHODS
53              
54             L inherits all methods from L
55             and implements the following new ones.
56              
57             =over
58              
59             =item STIX::Observable::Extension::PDF->new(%properties)
60              
61             Create a new instance of L.
62              
63             =item $pdf_ext->version
64              
65             Specifies the decimal version number of the string from the PDF header that
66             specifies the version of the PDF specification to which the PDF file conforms. E.g., '1.4'.
67              
68             =item $pdf_ext->is_optimized
69              
70             Specifies whether the PDF file has been optimized.
71              
72             =item $pdf_ext->document_info_dict
73              
74             Specifies details of the PDF document information dictionary (DID), which
75             includes properties like the document creation data and producer, as a dictionary.
76              
77             =item $pdf_ext->pdfid0
78              
79             Specifies the first file identifier found for the PDF file.
80              
81             =item $pdf_ext->pdfid1
82              
83             Specifies the second file identifier found for the PDF file.
84              
85             =back
86              
87              
88             =head2 HELPERS
89              
90             =over
91              
92             =item $pdf_ext->TO_JSON
93              
94             Helper for JSON encoders.
95              
96             =item $pdf_ext->to_hash
97              
98             Return the object HASH.
99              
100             =item $pdf_ext->to_string
101              
102             Encode the object in JSON.
103              
104             =item $pdf_ext->validate
105              
106             Validate the object using JSON Schema (see L).
107              
108             =back
109              
110              
111             =head1 SUPPORT
112              
113             =head2 Bugs / Feature Requests
114              
115             Please report any bugs or feature requests through the issue tracker
116             at L.
117             You will be notified automatically of any progress on your issue.
118              
119             =head2 Source Code
120              
121             This is open source software. The code repository is available for
122             public review and contribution under the terms of the license.
123              
124             L
125              
126             git clone https://github.com/giterlizzi/perl-STIX.git
127              
128              
129             =head1 AUTHOR
130              
131             =over 4
132              
133             =item * Giuseppe Di Terlizzi
134              
135             =back
136              
137              
138             =head1 LICENSE AND COPYRIGHT
139              
140             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
141              
142             This is free software; you can redistribute it and/or modify it under
143             the same terms as the Perl 5 programming language system itself.
144              
145             =cut