CycloneDX/CryptoProperties/RelatedCryptoMaterialProperties.pm

filter: Statementstmt 67.5% 54 / 80 Branchbran 0.0% 0 / 38 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 61.9% 13 / 21 Podpod 100% 1 / 1 totaltotal 48.5% 68 / 140 CC 20 SCAR 45.2
CC
20
Cov
46%
TO_JSON
240.0
__ANON__
6.0
__ANON__
6.0
CRAP 91.9
« CycloneDX/Patent.pm ↑ Summary CycloneDX/CryptoProperties/AlgorithmProperties.pm »
1 package SBOM::CycloneDX::CryptoProperties::RelatedCryptoMaterialProperties;
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::CryptoProperties::SecuredBy;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use SBOM::CycloneDX::Enum;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use SBOM::CycloneDX::Hash;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use SBOM::CycloneDX::Timestamp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use Types::Standard qw(Str Enum Num InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 extends 'SBOM::CycloneDX::Base';
21  
22 1 has type => (is => 'rw', isa => Enum [SBOM::CycloneDX::Enum->values('RELATED_CRYPTO_MATERIAL_TYPE')]);
23 1 has id => (is => 'rw', isa => Str);
24 1 has state => (is => 'rw', isa => Enum [SBOM::CycloneDX::Enum->values('RELATED_CRYPTO_MATERIAL_STATE')]);
25  
26 has algorithm_ref => (
27 is => 'rw',
28 isa => InstanceOf ['SBOM::CycloneDX::BomRef'],
29 0 ▶ coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::BomRef->new($_[0]) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
30 1 );
31  
32 has creation_date => (
33 is => 'rw',
34 isa => InstanceOf ['SBOM::CycloneDX::Timestamp'],
35 0 ▶ coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::Timestamp->new($_[0]) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
36 1 );
37  
38 has activation_date => (
39 is => 'rw',
40 isa => InstanceOf ['SBOM::CycloneDX::Timestamp'],
41 0 ▶ coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::Timestamp->new($_[0]) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
42 1 );
43  
44 has update_date => (
45 is => 'rw',
46 isa => InstanceOf ['SBOM::CycloneDX::Timestamp'],
47 0 ▶ coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::Timestamp->new($_[0]) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
48 1 );
49  
50 has expiration_date => (
51 is => 'rw',
52 isa => InstanceOf ['SBOM::CycloneDX::Timestamp'],
53 0 ▶ coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::Timestamp->new($_[0]) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
54 1 );
55  
56 1 has value => (is => 'rw', isa => Str);
57 1 has size => (is => 'rw', isa => Num);
58 1 has format => (is => 'rw', isa => Str);
59  
60 has secured_by => (
61 is => 'rw',
62 isa => InstanceOf ['SBOM::CycloneDX::CryptoProperties::SecuredBy'],
63 0 ▶ default => sub { SBOM::CycloneDX::CryptoProperties::SecuredBy->new }
Subroutine __ANON__: not called CC=1 SCAR=6.9
64 1 );
65  
66 1 has fingerprint => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Hash']);
67  
68 has related_cryptographic_assets => (
69 is => 'rw',
70 isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::CryptoProperties::RelatedCryptographicAsset']],
71 0 ▶ default => sub { SBOM::CycloneDX::List->new }
Subroutine __ANON__: not called CC=1 SCAR=6.9
72 1 );
73  
74 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=15 SCAR=54.8
Pod documented
75  
76 0 my $self = shift;
77  
78 0 my $json = {};
79  
80 0 ▶ $json->{type} = $self->type if $self->type;
Branch: 1 branch
BranchTrueFalseTotal
if $self->type 0 0 0
81 0 ▶ $json->{id} = $self->id if $self->id;
Branch: 1 branch
BranchTrueFalseTotal
if $self->id 0 0 0
82 0 ▶ $json->{state} = $self->state if $self->state;
Branch: 1 branch
BranchTrueFalseTotal
if $self->state 0 0 0
83 0 ▶ $json->{algorithmRef} = $self->algorithm_ref if $self->algorithm_ref;
Branch: 1 branch
BranchTrueFalseTotal
if $self->algorithm_ref 0 0 0
84 0 ▶ $json->{creationDate} = $self->creation_date if $self->creation_date;
Branch: 1 branch
BranchTrueFalseTotal
if $self->creation_date 0 0 0
85 0 ▶ $json->{activationDate} = $self->activation_date if $self->activation_date;
Branch: 1 branch
BranchTrueFalseTotal
if $self->activation_date 0 0 0
86 0 ▶ $json->{updateDate} = $self->update_date if $self->update_date;
Branch: 1 branch
BranchTrueFalseTotal
if $self->update_date 0 0 0
87 0 ▶ $json->{expirationDate} = $self->expiration_date if $self->expiration_date;
Branch: 1 branch
BranchTrueFalseTotal
if $self->expiration_date 0 0 0
88 0 ▶ $json->{value} = $self->value if $self->value;
Branch: 1 branch
BranchTrueFalseTotal
if $self->value 0 0 0
89 0 ▶ $json->{size} = $self->size if $self->size;
Branch: 1 branch
BranchTrueFalseTotal
if $self->size 0 0 0
90 0 ▶ $json->{format} = $self->format if $self->format;
Branch: 1 branch
BranchTrueFalseTotal
if $self->format 0 0 0
91 0 ▶ $json->{securedBy} = $self->secured_by if %{$self->secured_by->TO_JSON};
Branch: 1 branch
BranchTrueFalseTotal
if %{$self->secured_by->TO_JSON;} 0 0 0
92 0 ▶ $json->{fingerprint} = $self->fingerprint if $self->fingerprint;
Branch: 1 branch
BranchTrueFalseTotal
if $self->fingerprint 0 0 0
93 0 ▶ $json->{relatedCryptographicAssets} = $self->related_cryptographic_assets if @{$self->related_cryptographic_assets};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->related_cryptographic_assets;} 0 0 0
94  
95 0 return $json;
96  
97 }
98  
99 1 1;
100  
101 =encoding utf-8
102  
103 =head1 NAME
104  
105 SBOM::CycloneDX::CryptoProperties::RelatedCryptoMaterialProperties - Related Cryptographic Material Properties
106  
107 =head1 SYNOPSIS
108  
109 SBOM::CycloneDX::CryptoProperties::RelatedCryptoMaterialProperties->new();
110  
111  
112 =head1 DESCRIPTION
113  
114 L<SBOM::CycloneDX::CryptoProperties::RelatedCryptoMaterialProperties> specifies
115 properties for cryptographic assets of asset type: "related-crypto-material".
116  
117 =head2 METHODS
118  
119 L<SBOM::CycloneDX::CryptoProperties::RelatedCryptoMaterialProperties> inherits all methods from L<SBOM::CycloneDX::Base>
120 and implements the following new ones.
121  
122 =over
123  
124 =item SBOM::CycloneDX::CryptoProperties::RelatedCryptoMaterialProperties->new( %PARAMS )
125  
126 Properties:
127  
128 =over
129  
130 =item * C<activation_date>, The date and time (timestamp) when the related
131 cryptographic material was activated.
132  
133 =item * C<algorithm_ref>, The bom-ref to the algorithm used to generate the
134 related cryptographic material.
135  
136 =item * C<creation_date>, The date and time (timestamp) when the related
137 cryptographic material was created.
138  
139 =item * C<expiration_date>, The date and time (timestamp) when the related
140 cryptographic material expires.
141  
142 =item * C<fingerprint>, The fingerprint is a cryptographic hash of the asset.
143  
144 See L<SBOM::CycloneDX::Hash>
145  
146 =item * C<format>, The format of the related cryptographic material (e.g. P8,
147 PEM, DER).
148  
149 =item * C<id>, The unique identifier for the related cryptographic
150 material.
151  
152 =item * C<related_cryptographic_assets>, A list of cryptographic assets related
153 to this component.
154  
155 See L<SBOM::CycloneDX::CryptoProperties::RelatedCryptographicAsset>
156  
157 =item * C<secured_by>, The mechanism by which the cryptographic asset is
158 secured by.
159  
160 =item * C<size>, The size of the cryptographic asset (in bits).
161  
162 =item * C<state>, The key state as defined by NIST SP 800-57.
163  
164 =item * C<type>, The type for the related cryptographic material
165  
166 =item * C<update_date>, The date and time (timestamp) when the related
167 cryptographic material was updated.
168  
169 =item * C<value>, The associated value of the cryptographic material.
170  
171 =back
172  
173 =item $related_crypto_material_properties->activation_date
174  
175 =item $related_crypto_material_properties->algorithm_ref
176  
177 =item $related_crypto_material_properties->creation_date
178  
179 =item $related_crypto_material_properties->expiration_date
180  
181 =item $related_crypto_material_properties->format
182  
183 =item $related_crypto_material_properties->id
184  
185 =item $related_crypto_material_properties->secured_by
186  
187 =item $related_crypto_material_properties->size
188  
189 =item $related_crypto_material_properties->state
190  
191 =item $related_crypto_material_properties->type
192  
193 =item $related_crypto_material_properties->update_date
194  
195 =item $related_crypto_material_properties->value
196  
197 =back
198  
199  
200  
201 =head1 SUPPORT
202  
203 =head2 Bugs / Feature Requests
204  
205 Please report any bugs or feature requests through the issue tracker
206 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
207 You will be notified automatically of any progress on your issue.
208  
209 =head2 Source Code
210  
211 This is open source software. The code repository is available for
212 public review and contribution under the terms of the license.
213  
214 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
215  
216 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
217  
218  
219 =head1 AUTHOR
220  
221 =over 4
222  
223 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
224  
225 =back
226  
227  
228 =head1 LICENSE AND COPYRIGHT
229  
230 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
231  
232 This is free software; you can redistribute it and/or modify it under
233 the same terms as the Perl 5 programming language system itself.
234  
235 =cut
« CycloneDX/Patent.pm ↑ Summary CycloneDX/CryptoProperties/AlgorithmProperties.pm »