| 1 | package SBOM::CycloneDX::CryptoProperties::CertificateExtension; | ||||||||||
| 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::Enum; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Types::Standard qw(Str Enum); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | extends 'SBOM::CycloneDX::Base'; | |||||||||
| 16 | |||||||||||
| 17 | 1 | has common_extension_name => (is => 'rw', isa => Enum [SBOM::CycloneDX::Enum->values('COMMON_EXTENSION_NAME')]); | |||||||||
| 18 | 1 | has common_extension_value => (is => 'rw', isa => Str); | |||||||||
| 19 | 1 | has custom_extension_name => (is => 'rw', isa => Str); | |||||||||
| 20 | 1 | has custom_extension_value => (is => 'rw', isa => Str); | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||
| 23 | |||||||||||
| 24 | 0 | my $self = shift; | |||||||||
| 25 | |||||||||||
| 26 | 0 | my $json = {}; | |||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | $json->{commonExtensionName} = $self->common_extension_name if $self->common_extension_name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | ▶ | $json->{commonExtensionValue} = $self->common_extension_value if $self->common_extension_value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | ▶ | $json->{customExtensionName} = $self->custom_extension_name if $self->custom_extension_name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | ▶ | $json->{customExtensionValue} = $self->custom_extension_value if $self->custom_extension_value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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::CertificateExtension - Certificate Extensions | ||||||||||
| 44 | |||||||||||
| 45 | =head1 SYNOPSIS | ||||||||||
| 46 | |||||||||||
| 47 | SBOM::CycloneDX::CryptoProperties::CertificateExtension->new(); | ||||||||||
| 48 | |||||||||||
| 49 | |||||||||||
| 50 | =head1 DESCRIPTION | ||||||||||
| 51 | |||||||||||
| 52 | L<SBOM::CycloneDX::CryptoProperties::CertificateExtension> A certificate | ||||||||||
| 53 | extension is a field that provides additional information about the | ||||||||||
| 54 | certificate or its use. Extensions are used to convey additional | ||||||||||
| 55 | information beyond the standard fields. | ||||||||||
| 56 | |||||||||||
| 57 | =head2 METHODS | ||||||||||
| 58 | |||||||||||
| 59 | L<SBOM::CycloneDX::CryptoProperties::CertificateExtension> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 60 | and implements the following new ones. | ||||||||||
| 61 | |||||||||||
| 62 | =over | ||||||||||
| 63 | |||||||||||
| 64 | =item SBOM::CycloneDX::CryptoProperties::CertificateExtension->new( %PARAMS ) | ||||||||||
| 65 | |||||||||||
| 66 | Properties: | ||||||||||
| 67 | |||||||||||
| 68 | =over | ||||||||||
| 69 | |||||||||||
| 70 | =item * C<common_extension_name>, The name of the extension. | ||||||||||
| 71 | |||||||||||
| 72 | =over | ||||||||||
| 73 | |||||||||||
| 74 | =item * C<basicConstraints>, Specifies whether a certificate can be used as a | ||||||||||
| 75 | CA certificate or not. | ||||||||||
| 76 | |||||||||||
| 77 | =item * C<keyUsage>, Specifies the allowed uses of the public key in the | ||||||||||
| 78 | certificate. | ||||||||||
| 79 | |||||||||||
| 80 | =item * C<extendedKeyUsage>, Specifies additional purposes for which the public | ||||||||||
| 81 | key can be used. | ||||||||||
| 82 | |||||||||||
| 83 | =item * C<subjectAlternativeName>, Allows inclusion of additional names to | ||||||||||
| 84 | identify the entity associated with the certificate. | ||||||||||
| 85 | |||||||||||
| 86 | =item * C<authorityKeyIdentifier>, Identifies the public key of the CA that | ||||||||||
| 87 | issued the certificate. | ||||||||||
| 88 | |||||||||||
| 89 | =item * C<subjectKeyIdentifier>, Identifies the public key associated with the | ||||||||||
| 90 | entity the certificate was issued to. | ||||||||||
| 91 | |||||||||||
| 92 | =item * C<authorityInformationAccess>, Contains CA issuers and OCSP information. | ||||||||||
| 93 | |||||||||||
| 94 | =item * C<certificatePolicies>, Defines the policies under which the | ||||||||||
| 95 | certificate was issued and can be used. | ||||||||||
| 96 | |||||||||||
| 97 | =item * C<crlDistributionPoints>, Contains one or more URLs where a Certificate | ||||||||||
| 98 | Revocation List (CRL) can be obtained. | ||||||||||
| 99 | |||||||||||
| 100 | =item * C<signedCertificateTimestamp>, Shows that the certificate has been | ||||||||||
| 101 | publicly logged, which helps prevent the issuance of rogue certificates by a | ||||||||||
| 102 | CA. Log ID, timestamp and signature as proof | ||||||||||
| 103 | |||||||||||
| 104 | =back | ||||||||||
| 105 | |||||||||||
| 106 | =item * C<common_extension_value>, The value of the certificate extension. | ||||||||||
| 107 | |||||||||||
| 108 | =back | ||||||||||
| 109 | |||||||||||
| 110 | Custom extensions may convey application-specific or vendor-specific data not | ||||||||||
| 111 | covered by standard extensions. The structure and semantics of custom | ||||||||||
| 112 | extensions are typically defined outside of public standards. CycloneDX | ||||||||||
| 113 | leverages properties to support this capability. | ||||||||||
| 114 | |||||||||||
| 115 | =over | ||||||||||
| 116 | |||||||||||
| 117 | =item * C<custom_extension_name>, The name for the custom certificate extension. | ||||||||||
| 118 | |||||||||||
| 119 | =item * C<custom_extension_value>, The description of the custom certificate extension. | ||||||||||
| 120 | |||||||||||
| 121 | =back | ||||||||||
| 122 | |||||||||||
| 123 | =item $certificate_extension->common_extension_name | ||||||||||
| 124 | |||||||||||
| 125 | =item $certificate_extension->common_extension_value | ||||||||||
| 126 | |||||||||||
| 127 | =item $certificate_extension->custom_extension_name | ||||||||||
| 128 | |||||||||||
| 129 | =item $certificate_extension->custom_extension_value | ||||||||||
| 130 | |||||||||||
| 131 | =back | ||||||||||
| 132 | |||||||||||
| 133 | =head1 SUPPORT | ||||||||||
| 134 | |||||||||||
| 135 | =head2 Bugs / Feature Requests | ||||||||||
| 136 | |||||||||||
| 137 | Please report any bugs or feature requests through the issue tracker | ||||||||||
| 138 | at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 139 | You will be notified automatically of any progress on your issue. | ||||||||||
| 140 | |||||||||||
| 141 | =head2 Source Code | ||||||||||
| 142 | |||||||||||
| 143 | This is open source software. The code repository is available for | ||||||||||
| 144 | public review and contribution under the terms of the license. | ||||||||||
| 145 | |||||||||||
| 146 | L<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 147 | |||||||||||
| 148 | git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git | ||||||||||
| 149 | |||||||||||
| 150 | |||||||||||
| 151 | =head1 AUTHOR | ||||||||||
| 152 | |||||||||||
| 153 | =over 4 | ||||||||||
| 154 | |||||||||||
| 155 | =item * Giuseppe Di Terlizzi <gdt@cpan.org> | ||||||||||
| 156 | |||||||||||
| 157 | =back | ||||||||||
| 158 | |||||||||||
| 159 | |||||||||||
| 160 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 161 | |||||||||||
| 162 | This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi. | ||||||||||
| 163 | |||||||||||
| 164 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 165 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 166 | |||||||||||
| 167 | =cut | ||||||||||