original_docstring: 
      This method creates the SoftwareIdentity-Tag for the SWID.
      :param from_folder: Root-Folder for the Evidence-Tag.
      :param ctx: Information of package and arguments given by User (example: full-flag, regid, etc.)
      :param from_package_file: Flag if the File-List comes from a Package-File or a local installed Package.
      :return: Whole Identification-Tag with all Information given.
      
docstring: This method creates the SoftwareIdentity-Tag for the SWID.
docstring_tokens: This method creates the SoftwareIdentity - Tag for the SWID .
code: def create_software_identity_element(ctx, from_package_file=False, from_folder=False):
      """
      This method creates the SoftwareIdentity-Tag for the SWID.
      :param from_folder: Root-Folder for the Evidence-Tag.
      :param ctx: Information of package and arguments given by User (example: full-flag, regid, etc.)
      :param from_package_file: Flag if the File-List comes from a Package-File or a local installed Package.
      :return: Whole Identification-Tag with all Information given.
      """
      software_identity = ET.Element('SoftwareIdentity')
      software_identity.set('xmlns', XMLNS)
      software_identity.set('xmlns:n8060', N8060)
      if ctx['schema_location']:
          software_identity.set('xmlns:xsi', XSI)
          software_identity.set('xsi:schemaLocation', SCHEMA_LOCATION)
      software_identity.set('name', ctx['package_info'].package)
      software_identity.set('xml:lang', ctx['xml_lang'])
      software_identity.set('tagId', create_unique_id(ctx['package_info'], ctx['os_string'], ctx['architecture'], ctx['id_prefix']))
      software_identity.set('version', ctx['package_info'].version)
      software_identity.set('versionScheme', VERSION_SCHEME)
  
      entity = ET.SubElement(software_identity, 'Entity')
      entity.set('name', ctx['entity_name'])
      entity.set('regid', ctx['regid'])
      entity.set('role', ROLE)
  
      product_meta = ET.SubElement(software_identity, 'Meta')
      if ctx['meta_for'] == 'os':
          product_meta.set('product', create_system_id(ctx['os_string'], ctx['architecture']))
      else:
          product_meta.set('product', ctx['package_info'].package)
          colloquialVersion = re.sub(r'-.+$', '', ctx['package_info'].version)
          product_meta.set('colloquialVersion', colloquialVersion)
          if ctx['package_info'].summary:
              product_meta.set('summary', ctx['package_info'].summary)
  
      if ctx['full']:
  
          if 'sha256' in ctx['hash_algorithms']:
              software_identity.set('xmlns:SHA256', SHA256NS)
          if 'sha384' in ctx['hash_algorithms']:
              software_identity.set('xmlns:SHA384', SHA384NS)
          if 'sha512' in ctx['hash_algorithms']:
              software_identity.set('xmlns:SHA512', SHA512NS)
  
          if from_package_file:
              ctx['package_info'].files.extend(ctx['environment'].get_files_from_packagefile(ctx['file_path']))
          elif from_folder:
              for folder in ctx['evidence_paths']:
                  ctx['package_info'].files.extend(ctx['environment'].get_files_from_folder(folder, ctx['new_root_path']))
              ctx['package_info'].files.sort(key=lambda file: file.actual_full_pathname)
          else:
              ctx['package_info'].files.extend(ctx['environment'].get_files_for_package(ctx['package_info']))
  
          if ctx['hierarchic']:
              if from_folder:
                  content_tag = _create_hierarchic_evidence_tag(ctx['package_info'], ctx['hash_algorithms'])
              else:
                  content_tag = _create_hierarchic_payload_tag(ctx['package_info'], ctx['hash_algorithms'])
          else:
              if from_folder:
                  content_tag = _create_flat_evidence_tag(ctx['package_info'], ctx['hash_algorithms'])
              else:
                  content_tag = _create_flat_payload_tag(ctx['package_info'], ctx['hash_algorithms'])
  
          software_identity.append(content_tag)
  
      return software_identity
code_tokens: def create_software_identity_element ( ctx , from_package_file = False , from_folder = False ) : software_identity = ET . Element ( 'SoftwareIdentity' ) software_identity . set ( 'xmlns' , XMLNS ) software_identity . set ( 'xmlns:n8060' , N8060 ) if ctx [ 'schema_location' ] : software_identity . set ( 'xmlns:xsi' , XSI ) software_identity . set ( 'xsi:schemaLocation' , SCHEMA_LOCATION ) software_identity . set ( 'name' , ctx [ 'package_info' ] . package ) software_identity . set ( 'xml:lang' , ctx [ 'xml_lang' ] ) software_identity . set ( 'tagId' , create_unique_id ( ctx [ 'package_info' ] , ctx [ 'os_string' ] , ctx [ 'architecture' ] , ctx [ 'id_prefix' ] ) ) software_identity . set ( 'version' , ctx [ 'package_info' ] . version ) software_identity . set ( 'versionScheme' , VERSION_SCHEME ) entity = ET . SubElement ( software_identity , 'Entity' ) entity . set ( 'name' , ctx [ 'entity_name' ] ) entity . set ( 'regid' , ctx [ 'regid' ] ) entity . set ( 'role' , ROLE ) product_meta = ET . SubElement ( software_identity , 'Meta' ) if ctx [ 'meta_for' ] == 'os' : product_meta . set ( 'product' , create_system_id ( ctx [ 'os_string' ] , ctx [ 'architecture' ] ) ) else : product_meta . set ( 'product' , ctx [ 'package_info' ] . package ) colloquialVersion = re . sub ( r'-.+$' , '' , ctx [ 'package_info' ] . version ) product_meta . set ( 'colloquialVersion' , colloquialVersion ) if ctx [ 'package_info' ] . summary : product_meta . set ( 'summary' , ctx [ 'package_info' ] . summary ) if ctx [ 'full' ] : if 'sha256' in ctx [ 'hash_algorithms' ] : software_identity . set ( 'xmlns:SHA256' , SHA256NS ) if 'sha384' in ctx [ 'hash_algorithms' ] : software_identity . set ( 'xmlns:SHA384' , SHA384NS ) if 'sha512' in ctx [ 'hash_algorithms' ] : software_identity . set ( 'xmlns:SHA512' , SHA512NS ) if from_package_file : ctx [ 'package_info' ] . files . extend ( ctx [ 'environment' ] . get_files_from_packagefile ( ctx [ 'file_path' ] ) ) elif from_folder : for folder in ctx [ 'evidence_paths' ] : ctx [ 'package_info' ] . files . extend ( ctx [ 'environment' ] . get_files_from_folder ( folder , ctx [ 'new_root_path' ] ) ) ctx [ 'package_info' ] . files . sort ( key = lambda file : file . actual_full_pathname ) else : ctx [ 'package_info' ] . files . extend ( ctx [ 'environment' ] . get_files_for_package ( ctx [ 'package_info' ] ) ) if ctx [ 'hierarchic' ] : if from_folder : content_tag = _create_hierarchic_evidence_tag ( ctx [ 'package_info' ] , ctx [ 'hash_algorithms' ] ) else : content_tag = _create_hierarchic_payload_tag ( ctx [ 'package_info' ] , ctx [ 'hash_algorithms' ] ) else : if from_folder : content_tag = _create_flat_evidence_tag ( ctx [ 'package_info' ] , ctx [ 'hash_algorithms' ] ) else : content_tag = _create_flat_payload_tag ( ctx [ 'package_info' ] , ctx [ 'hash_algorithms' ] ) software_identity . append ( content_tag ) return software_identity
short_docstring: This method creates the SoftwareIdentity-Tag for the SWID.
short_docstring_tokens: This method creates the SoftwareIdentity - Tag for the SWID .
comment: """
      This method creates the SoftwareIdentity-Tag for the SWID.
      :param from_folder: Root-Folder for the Evidence-Tag.
      :param ctx: Information of package and arguments given by User (example: full-flag, regid, etc.)
      :param from_package_file: Flag if the File-List comes from a Package-File or a local installed Package.
      :return: Whole Identification-Tag with all Information given.
      """