File Coverage

blib/lib/SBOM/CycloneDX/CryptoProperties/SecuredBy.pm
Criterion Covered Total %
statement 26 32 81.2
branch 0 4 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 47 76.6


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::CryptoProperties::SecuredBy;
2              
3 1     1   20 use 5.010001;
  1         5  
4 1     1   6 use strict;
  1         2  
  1         41  
5 1     1   6 use warnings;
  1         2  
  1         61  
6 1     1   6 use utf8;
  1         2  
  1         7  
7              
8 1     1   40 use SBOM::CycloneDX::List;
  1         2  
  1         44  
9              
10 1     1   5 use Types::Standard qw(Str);
  1         3  
  1         10  
11 1     1   3956 use Types::TypeTiny qw(ArrayLike);
  1         3  
  1         8  
12              
13 1     1   642 use Moo;
  1         3  
  1         10  
14 1     1   489 use namespace::autoclean;
  1         3  
  1         10  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has mechanism => (is => 'rw', isa => Str);
19              
20             # bom-ref like
21             has algorithm_ref => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
22              
23              
24             sub TO_JSON {
25              
26 0     0 1   my $self = shift;
27              
28 0           my $json = {};
29              
30 0 0         $json->{mechanism} = $self->mechanism if $self->mechanism;
31 0 0         $json->{algorithmRef} = $self->algorithm_ref if @{$self->algorithm_ref};
  0            
32              
33 0           return $json;
34              
35             }
36              
37             1;
38              
39             =encoding utf-8
40              
41             =head1 NAME
42              
43             SBOM::CycloneDX::CryptoProperties::SecuredBy - The mechanism by which the cryptographic asset is secured by
44              
45             =head1 SYNOPSIS
46              
47              
48             =head1 DESCRIPTION
49              
50             L specifies the mechanism by which the cryptographic asset is secured by.
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 SBOM::CycloneDX::CryptoProperties::SecuredBy->new( %PARAMS )
60              
61             Properties:
62              
63             =over
64              
65             =item * C, Specifies the mechanism by which the cryptographic
66             asset is secured by (examples C, C, C, C, C)
67              
68             =item * C, The list of bom-ref to the algorithm.
69              
70             =back
71              
72             =item $secured_by->mechanism
73              
74             =item $secured_by->algorithm_ref
75              
76             =back
77              
78             =head1 SUPPORT
79              
80             =head2 Bugs / Feature Requests
81              
82             Please report any bugs or feature requests through the issue tracker
83             at L.
84             You will be notified automatically of any progress on your issue.
85              
86             =head2 Source Code
87              
88             This is open source software. The code repository is available for
89             public review and contribution under the terms of the license.
90              
91             L
92              
93             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
94              
95              
96             =head1 AUTHOR
97              
98             =over 4
99              
100             =item * Giuseppe Di Terlizzi
101              
102             =back
103              
104              
105             =head1 LICENSE AND COPYRIGHT
106              
107             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
108              
109             This is free software; you can redistribute it and/or modify it under
110             the same terms as the Perl 5 programming language system itself.
111              
112             =cut