> ArrayLike [HashRef], default => sub { SBOM::CycloneDX::List->new });
sub TO_JSON {
my $self = shift;
my $json = {
subjects => $self->subjects,
annotator => $self->annotat
=> $self->text
};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{signature} = $self->signature if $self->signature;
return $json;
}
1;
=encoding utf-8
=hea
k intro 'urn:cdx:' to avoid
conflicts with BOM-Links.
=item C<signature>, Enveloped signature in JSON Signature Format (JSF)
(L<https://cyberphone.github.io/doc/security/jsf.html>).
=item C<subjects
b TO_JSON {
my $self = shift;
my $json = {};
$json->{score} = $self->score if $self->score;
$json->{rationale} = $self->rationale if $self->rationale;
return $json;
}
=> 'rw', isa => Enum [qw(base64)]);
has content => (is => 'rw', required => 1);
sub TO_JSON {
my $self = shift;
# TODO use trigger
# TODO guess mime/type from content
C
my $json = {content => $content};
$json->{contentType} = $self->content_type if $self->content_type;
$json->{encoding} = $self->encoding if $self->encoding;
return $json;
}
1
cifies the optional encoding the text is represented in.
=item $c->TO_JSON
Convert the attachment in JSON.
say encode_json($attachment);
# {
# "content": "Y29uc29sZS5sb2coJ0dvb2RCeWU
loneDX::List->new }
);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{vendor} = $self->vendor if $self->vendor;
$json->{name} = $self
self->name;
$json->{version} = $self->version if $self->version;
$json->{hashes} = $self->hashes if @{$self->hashes};
$json->{externalRefere
nces} = $self->external_references if @{$self->external_references};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Tool - Tool
=head1 SYNOPSIS
SBOM::CycloneDX::Tool->
}
);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{name} = $self->name if $self->name;
$json->{address}
ess if %{$self->address->TO_JSON};
$json->{url} = $self->url if @{$self->url};
$json->{contact} = $self->contact if @{$self->contact};
return $json;
}
1;
=encoding utf-8
=
TO_JSON {
my $self = shift;
my $json = {};
$json->{versions} = $self->versions if $self->versions;
$json->{range} = $self->range->to_string if $self->range;
$json->{
status} = $self->status if $self->status;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Version - Version
=head1 SYNOPSIS
SBOM::CycloneDX::Version->new();
tr);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{name} = $self->name if $self->name;
$json->{email}
= $self->email if $self->email;
$json->{phone} = $self->phone if $self->phone;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::OrganizationalContact - Organizat
=> 'rw', isa => HashRef);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{assessors} = $self->assessors if @{$self->assessors};
$json->{attestations} = $self->attestat
{$self->attestations};
$json->{claims} = $self->claims if @{$self->claims};
$json->{evidence} = $self->evidence if @{$self->evidence};
$json->{targets} = $self->ta
if $self->targets;
$json->{affirmation} = $self->affirmation if $self->affirmation;
$json->{signature} = $self->signature if $self->signature;
return $json;
}
1;
=encoding utf-
lt => sub { SBOM::CycloneDX::List->new }
);
sub TO_JSON {
my $self = shift;
my $json = {standards => $self->standards};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::Cyclon
rw', isa => HashRef);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom if $self->bom_ref;
$json->{name} = $self
elf->name;
$json->{version} = $self->version if $self->version;
$json->{description} = $self->description if $self->description;
$json->{owner}
>owner;
$json->{requirements} = $self->requirements if @{$self->requirements};
$json->{levels} = $self->levels if @{$self->levels};
$json->{externalRe
=> (is => 'rw', isa => Str);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{assetType} = $self->asset_type if $self->asset_type;
$json->{algorithmProperties} = $self->al
%{$self->algorithm_properties->TO_JSON};
$json->{certificateProperties} = $self->certificate_properties if %{$self->certificate_properties->TO_JSON};
$json->{relatedCryptoMaterialProperties}
operties->TO_JSON};
$json->{protocolProperties} = $self->protocol_properties if %{$self->protocol_properties->TO_JSON};
$json->{oid} = $self->oid if $self->oid;
return $json;
}
1;
=e
]->alg} != length($_[0]->content);
}
sub TO_JSON {
my $self = shift;
my $json = {alg => $self->alg, content => $self->content};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM
s->$orig(@args);
};
has value => (is => 'rw', required => 1);
sub to_string { shift->TO_JSON }
sub TO_JSON { shift->value }
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::BomRef - BOM-ref rep
eDX::BomRef->new( %PARAMS )
=item $bom_ref->value
=item $bom_ref->to_string
=item $bom_ref->TO_JSON
Return BOM ref.
=back
=head1 SUPPORT
=head2 Bugs / Feature Requests
Please report any bugs o
O_JSON {
my $self = shift;
my $json = {};
$json->{custodians} = $self->custodians if @{$self->custodians};
$json->{stewards} = $self->stewards if @{$self->stewards};
$json->
{owners} = $self->owners if @{$self->owners};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::DataGovernance - Data Governance
=head1 SYNOPSIS
SBOM::CycloneDX::
CycloneDX::List->new }
);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{id} = $self->id
$self->source;
$json->{references} = $self->references if @{$self->references};
$json->{ratings} = $self->ratings if @{$self->ratings};
$json->{cwes} =
if @{$self->cwes};
$json->{description} = $self->description if $self->description;
$json->{detail} = $self->detail if $self->detail;
$json->{recommendation} = $s
List->new }
);
sub TO_JSON {
my $self = shift;
my $json = {url => $self->url, type => $self->type};
$json->{comment} = $self->comment if $self->comment;
$json->{hashes} = $self->h
ashes if @{$self->hashes};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::ExternalReference - External Reference
=head1 SYNOPSIS
SBOM::CycloneDX::ExternalReference->n
sub TO_JSON {
my $self = shift;
my $json = {type => $self->type, name => $self->name};
$json->{'mime-type'} = $self->mime_type if $self->mime_type;
$json->{'bom-
>bom_ref;
$json->{supplier} = $self->supplier if $self->supplier;
$json->{manufacturer} = $self->manufacturer if $self->manufacturer;
$json->{authors}
f->authors};
$json->{author} = $self->author if $self->author;
$json->{publisher} = $self->publisher if $self->publisher;
$json->{group}
_JSON {
my $self = shift;
my $json = {};
$json->{timestamp} = $self->timestamp if $self->timestamp;
$json->{lifecycles} = $self->lifecycles if @{$self->lifecycles};
$json-
if @{$self->tools};
$json->{authors} = $self->authors if @{$self->authors};
$json->{component} = $self->component if $self->component;
$json->{manufacture} = $self->manuf
re if $self->manufacture;
$json->{supplier} = $self->supplier if $self->supplier;
$json->{licenses} = $self->licenses if @{$self->licenses};
$json->{properties} = $self->prope
TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{components} = $self->components if @{$self->components};
$json->{s
@{$self->services};
$json->{workflows} = $self->workflows if @{$self->workflows};
$json->{properties} = $self->properties if @{$self->properties};
return $json;
}
1;
=encoding utf-8
TO_JSON {
my $self = shift;
my $json = {};
$json->{attachment} = $self->attachment if $self->attachment;
$json->{url} = $self->url if $self->url;
return $json;