class CycloneDX::Component

Overview

Represents a component in the CycloneDX Bill of Materials (BOM). This class is responsible for defining the structure and serialization of a software component, including its type, name, version, and PURL.

Included Modules

Defined in:

cyclonedx/component.cr

Constant Summary

DEFAULT_TYPE = "library"
VALID_SCOPES = ["required", "optional", "excluded"]
VALID_TYPES = ["application", "framework", "library", "container", "platform", "operating-system", "device", "device-driver", "firmware", "file", "machine-learning-model", "data", "cryptographic-asset"]

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, version : String, component_type : String = DEFAULT_TYPE, purl : String | Nil = nil, description : String | Nil = nil, author : String | Nil = nil, licenses : Array(License | LicenseExpression) | Nil = nil, external_references : Array(ExternalReference) | Nil = nil, bom_ref : String | Nil = nil, scope : String | Nil = nil, hashes : Array(Hash) | Nil = nil, properties : Array(Property) | Nil = nil, group : String | Nil = nil, copyright : String | Nil = nil, cpe : String | Nil = nil, supplier : OrganizationalEntity | Nil = nil, manufacturer : OrganizationalEntity | Nil = nil, publisher : String | Nil = nil, mime_type : String | Nil = nil, components : Array(Component) | Nil = nil, tags : Array(String) | Nil = nil, omnibor_id : Array(String) | Nil = nil, swhid : Array(String) | Nil = nil, pedigree : Pedigree | Nil = nil, evidence : Evidence | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def author : String | Nil #

[View source]
def bom_ref : String | Nil #

[View source]
def component_type : String #

[View source]
def components : Array(Component) | Nil #

[View source]
def copyright : String | Nil #

[View source]
def cpe : String | Nil #

[View source]
def description : String | Nil #

[View source]
def evidence : Evidence | Nil #

[View source]
def external_references : Array(ExternalReference) | Nil #

[View source]
def group : String | Nil #

[View source]
def hashes : Array(Hash) | Nil #

[View source]
def licenses : Array(License | LicenseExpression) | Nil #

[View source]
def manufacturer : OrganizationalEntity | Nil #

[View source]
def mime_type : String | Nil #

[View source]
def name : String #

[View source]
def omnibor_id : Array(String) | Nil #

[View source]
def pedigree : Pedigree | Nil #

[View source]
def properties : Array(Property) | Nil #

[View source]
def publisher : String | Nil #

[View source]
def purl : String | Nil #

[View source]
def scope : String | Nil #

[View source]
def supplier : OrganizationalEntity | Nil #

[View source]
def swhid : Array(String) | Nil #

[View source]
def tags : Array(String) | Nil #

[View source]
def to_xml(xml : XML::Builder) : Nil #

[View source]
def version : String #

[View source]