TO_JSON {
my $self = shift;
my $json = {};
$json->{source} = $self->source if $self->source;
$json->{score} = $self->score if $self->score;
$json->
if $self->severity;
$json->{method} = $self->method if $self->method;
$json->{vector} = $self->vector if $self->vector;
$json->{justification} = $self->jus
tification if $self->justification;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Vulnerability::Rating - Rating
=head1 SYNOPSIS
SBOM::CycloneDX::Vulnerability::Ratin
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{summary} = $self->summary if $self->summary;
$json->{assessor} = $self->assessor if $self->assessor;
$json->{map}
= $self->map if @{$self->map};
$json->{signature} = $self->signature if $self->signature;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Declarations::Attest
ttestors
declared conformance and confidence thereof.
=item C<signature>, Enveloped signature in JSON Signature Format (JSF)
(L<https://cyberphone.github.io/doc/security/jsf.html>).
=item C<summary>
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{phase} = $self->phase if $self->phase;
$json->{name} = $self->name if $self->name;
$json->{desc
ription} = $self->description if $self->description;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Metadata::Lifecycle - Lifecycle
=head1 SYNOPSIS
SBOM::CycloneDX::Me
lnerability::Source'], required => 1);
sub TO_JSON {
my $self = shift;
my $json = {id => $self->id, source => $self->source};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::
);
use HiPi::Energenie;
use HiPi::Utils::Config;
use Getopt::Long qw( GetOptionsFromArray );
use JSON;
use Try::Tiny;
use HiPi::RF::OpenThings::Message;
our $VERSION ='0.82';
__PACKAGE__->create_ac
) {
if( lc($arg) eq '--json' ) {
$self->mode('json');
} elsif( lc($arg) eq '--pretty' ) {
$self->mode('json');
$self->pretty(1)
return $result;
}
sub return_result {
my $self = shift;
if($self->mode eq 'json') {
if( exists( $self->result->{data}) && ref($self->result->{data})->isa('HiPi::RF::Open
isa => Num);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{primitive} = $self->primitive if $self->primitive;
$json->{parameterSetIdentif
ntifier if $self->parameter_set_identifier;
$json->{curve} = $self->curve if $self->curve;
$json->{executionEnvironment} = $self->execution_envi
if $self->execution_environment;
$json->{implementationPlatform} = $self->implementation_platform if $self->implementation_platform;
$json->{certificationLevel} = $self->certi
F::Message );
use HiPi qw( :openthings :energenie );
use HiPi::RF::OpenThings;
use Try::Tiny;
use JSON;
our $VERSION ='0.89';
__PACKAGE__->create_accessors( qw(
cryptseed
epoch
length
}
}
}
return $data;
}
sub json {
my ($self, $pretty) = @_;
my $data = $self->value_hash;
my $output = try {
my $j = JSON->new;
my $return = ( $pretty ) ? $
TO_JSON {
my $self = shift;
my $json = {};
$json->{name} = $self->name if $self->name;
$json->{algorithms} = $self->algorithms if @{$self->algorithms};
$json->{
identifiers} = $self->identifiers if @{$self->identifiers};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::CryptoProperties::CipherSuite - Object representing
a cipher suite
loneDX::List->new });
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{type} = $self->type if $self->type;
$json->{version} = $sel
$json->{cipherSuites} = $self->cipher_suites if @{$self->cipher_suites};
$json->{ikev2TransformTypes} = $self->ikev2_transform_types if $self->ikev2_transform_types;
$json->{
cryptoRefArray} = $self->crypto_ref_array if @{$self->crypto_ref_array};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::CryptoProperties::ProtocolProperties - Prot
M::CycloneDX::Service']);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{organization} = $self->organization if $self->organization;
$json->{individual} = $self->individu
nt} = $self->component if $self->component;
$json->{service} = $self->service if $self->service;
my @check = keys %{$json};
if (scalar @check != 1) {
Carp::croak
on", "individual", "component" and "service" cannot be used at the same time';
}
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Annotation::Annotator - Annotator
=head1
O_JSON {
my $self = shift;
my $json = {};
$json->{type} = $self->type if $self->type;
$json->{id} = $self->id if $self->id;
$json->
$self->state;
$json->{algorithmRef} = $self->algorithm_ref if $self->algorithm_ref;
$json->{creationDate} = $self->creation_date if $self->creation_date;
$json->{activationDate} =
tivation_date;
$json->{updateDate} = $self->update_date if $self->update_date;
$json->{expirationDate} = $self->expiration_date if $self->expiration_date;
$json->{value} =
@_ );
}
sub checkMaster {
my ( $self, $args ) = @_;
delete $self->{failure};
require JSON;
require LWP::UserAgent;
require IO::Socket::SSL;
my $ua = LWP::UserAgent->new(
$resp = $ua->get($patroniUrl);
if ( $resp->is_success ) {
my $c = eval { JSON::from_json( $resp->decoded_content ) };
if ( $@ or !$c->{members} or ref( $c->{members} )
a => Str);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{name} = $self->name if $self->name;
$json->{url} = $self->url if $self->url;
return $json;
}
1;
=encodin
oneDX::List->new }
);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{identifier} = $self
lf->identifier;
$json->{title} = $self->title if $self->title;
$json->{text} = $self->text if $self->text;
$json->{descriptions}
escriptions;
$json->{openCre} = $self->open_cre if $self->open_cre;
$json->{parent} = $self->parent if $self->parent;
$json->{properties}
Carp;
use Data::Dumper;
use English qw( -no_match_vars );
use ExtUtils::MM;
use Getopt::Long;
use JSON;
use Module::CoreList;
use Pod::Usage;
use Pod::Find qw( pod_where );
use Readonly;
use IO::Scala
w( Class::Accessor::Fast );
our @OPTIONS = qw(
add_version
core
handle
include_require
json
min_core_version
path
perlreq
raw
require
separator
text
);
__PACKAGE__->follow_be
to
# test modules against Perls that are older than 5.8.9 - however,
# some modules like JSON::PP did not appear until after 5.10
if ($removed_version) {
$core = $removed_version >
O_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{identifier} = $self->identifier if $self->identifier;
$json-
f $self->title;
$json->{description} = $self->description if $self->description;
$json->{requirements} = $self->requirements if @{$self->requirements};
return $json;
}
1;
=encoding u
I::Simple->new(
option_specs => [ qw( help format=s ) ],
default_options => { format => 'json' }, # set some defaults
extra_options => [ qw( content ) ], # non-option, setter/getter
c
I::Simple->new(
option_specs => [qw( help format=s )],
default_options => { format => 'json' }, # set some defaults
extra_options => [qw( content )], # non-option, setter/gette
ith a clear error.
=back
=head2 Usage examples
# Using an option alias
script.pl --cfg app.json execute
# Using a command alias
script.pl ls
After parsing, both C<get_config()> and C<get_
er;
use English qw(-no_match_vars);
use JSON qw(decode_json);
use List::Util qw(none);
use parent qw(Exporter);
our @EXPORT_OK = qw( slurp slurp_json dump_json normalize_options dmp);
our $VERSION
p_json {
########################################################################
my ($file) = @_;
my $json = eval { return decode_json( slurp($file) ) };
croak "ERROR: could not decode JSON s
tring:\n$EVAL_ERROR\n"
if !$json || $EVAL_ERROR;
return $json;
}
########################################################################
sub slurp {
##########################################
cloneDX::Property']]);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{bom} = $self->bom if $self->bom;
$json->{modelParameters} = $se
$json->{quantitativeAnalysis} = $self->quantitativeAnalysis if $self->quantitative_analysis;
$json->{considerations} = $self->considerations if $self->considerations;
$json->{p
roperties} = $self->properties if @{$self->properties};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Component::ModelCard - Model Card
=head1 SYNOPSIS
:CycloneDX::List->new });
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{mechanism} = $self->mechanism if $self->mechanism;
$json->{algorithmRef} = $self->algorithm
_ref if @{$self->algorithm_ref};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::CryptoProperties::SecuredBy - The mechanism by which the cryptographic asset is secured by
=