CycloneDX/CryptoProperties/SecuredBy.pm

filter: Statementstmt 81.0% 30 / 37 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 100% 1 / 1 totaltotal 75.4% 40 / 53 CC 3 SCAR 12.7
CC
3
Cov
73%
TO_JSON
12.0
__ANON__
1.1
BEGIN
1.0
CRAP 3.5
« CycloneDX/Annotation.pm ↑ Summary CycloneDX/Tools.pm »
1 package SBOM::CycloneDX::CryptoProperties::SecuredBy;
2  
3 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Types::Standard qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 extends 'SBOM::CycloneDX::Base';
17  
18 1 has mechanism => (is => 'rw', isa => Str);
19  
20 # bom-ref like
21 0 ▶has algorithm_ref => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
Subroutine __ANON__: not called CC=1 SCAR=1.2
22  
23  
24 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=3 SCAR=24.8
Pod documented
25  
26 0 my $self = shift;
27  
28 0 my $json = {};
29  
30 0 ▶ $json->{mechanism} = $self->mechanism if $self->mechanism;
Branch: 1 branch
BranchTrueFalseTotal
if $self->mechanism 0 0 0
31 0 ▶ $json->{algorithmRef} = $self->algorithm_ref if @{$self->algorithm_ref};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->algorithm_ref;} 0 0 0
32  
33 0 return $json;
34  
35 }
36  
37 1 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<SBOM::CycloneDX::CryptoProperties::SecuredBy> specifies the mechanism by which the cryptographic asset is secured by.
51  
52 =head2 METHODS
53  
54 L<SBOM::CycloneDX::CryptoProperties::SecuredBy> inherits all methods from L<SBOM::CycloneDX::Base>
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<mechanism>, Specifies the mechanism by which the cryptographic
66 asset is secured by (examples C<HSM>, C<TPM>, C<SGX>, C<Software>, C<None>)
67  
68 =item * C<algorithm_ref>, 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
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<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
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 <gdt@cpan.org>
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
« CycloneDX/Annotation.pm ↑ Summary CycloneDX/Tools.pm »