<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.qualcomm.com/secimage"
    xmlns:tns="http://www.qualcomm.com/secimage">

    <element name="secimage">
        <complexType>
            <all>
                <element name="metadata" type="tns:complex_metadata" />
                <element name="general_properties" type="tns:complex_general_properties" />
                <element name="parsegen" type="tns:complex_parsegen" maxOccurs="1" minOccurs="0"/>
                <element name="signing" type="tns:complex_signing" />
                <element name="post_process" type="tns:complex_post_process" />
                <element name="images_list" type="tns:complex_images_list" />
                <element name="data_provisioning" type="tns:complex_data_provisioning" />
            </all>
        </complexType>
    </element>

    <complexType name="complex_metadata">
        <all>
            <element name="chipset" type="string" maxOccurs="1" minOccurs="0" default="default"/>
            <element name="version" type="string" maxOccurs="1" minOccurs="0" default="2.0"/>
        </all>
    </complexType>

    <complexType name="complex_general_properties">
        <all>
            <element name="selected_signer" type="string" maxOccurs="1" minOccurs="0" />
            <element name="selected_encryptor" type="string" maxOccurs="1" minOccurs="0" />
            <element name="selected_cert_config" type="string" maxOccurs="1" minOccurs="0" default="default"/>
            <element name="max_cert_size" type="int" maxOccurs="1" minOccurs="0" default="2048"/>
            <element name="key_size" type="int" maxOccurs="1" minOccurs="0" default="2048"/>
            <element name="num_certs_in_certchain" type="int" maxOccurs="1" minOccurs="0" default="3"/>
            <element name="num_root_certs" type="int" maxOccurs="1" minOccurs="0" default="1"/>
            <element name="max_num_root_certs" type="int" maxOccurs="1" minOccurs="0" default="4"/>
            <element name="testsig_serialnum" type="string" maxOccurs="1" minOccurs="0" />
            <element name="mrc_index" type="int" maxOccurs="1" minOccurs="0" default="0"/>
            <element name="msm_part" type="string" maxOccurs="1" minOccurs="0" default="0x00000000"/>
            <element name="oem_id" type="string" maxOccurs="1" minOccurs="0" default="0x0000"/>
            <element name="model_id" type="string" maxOccurs="1" minOccurs="0" default="0x0000"/>
            <element name="sw_id" type="string" maxOccurs="1" minOccurs="0" default="0x0000000000000000"/>
            <element name="anti_rollback_version" type="string" maxOccurs="1" minOccurs="0" default="0x0000000000000000"/>
            <element name="app_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="crash_dump" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="rot_en" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="soc_hw_version" type="string" maxOccurs="1" minOccurs="0" default="0x00000000"/>
            <element name="soc_vers" type="string" maxOccurs="1" minOccurs="0" />
            <element name="mask_soc_hw_version" type="string" maxOccurs="1" minOccurs="0" />
            <element name="in_use_soc_hw_version" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="use_serial_number_in_signing" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="serial_number" type="string" maxOccurs="1" minOccurs="0" />
            <element name="multi_serial_numbers" type="tns:complex_multi_serial_numbers" maxOccurs="1" minOccurs="0"/>
            <element name="debug" type="string" maxOccurs="1" minOccurs="0" default="nop"/>
            <element name="exponent" type="int" maxOccurs="1" minOccurs="0" default="257"/>
            <element name="object_id" type="tns:complex_oid" maxOccurs="1" minOccurs="0" />
            <element name="pmbl_properties" type="tns:complex_pmbl_properties" maxOccurs="1" minOccurs="0" />
            <element name="cass_capability" type="string" maxOccurs="1" minOccurs="0" />
            <element name="hash_pageseg_as_segment" type="boolean" maxOccurs="1" minOccurs="0" default="false"/>
            <element name="hash_algorithm" type="string" maxOccurs="1" minOccurs="0" default="sha256"/>
            <element name="segment_hash_algorithm" type="string" maxOccurs="1" minOccurs="0" default="sha256"/>
            <element name="cass_attest_cert" type="string" maxOccurs="1" minOccurs="0" />
            <element name="rsa_padding" type="string" maxOccurs="1" minOccurs="0" default="pkcs"/>
            <element name="hmac" type="boolean" maxOccurs="1" minOccurs="0" default="true"/>
            <element name="secboot_version" type="string" maxOccurs="1" minOccurs="0" default="1.0"/>
            <element name="qti_sign" type="boolean" maxOccurs="1" minOccurs="0" default="false"/>
            <element name="oem_sign" type="boolean" maxOccurs="1" minOccurs="0" default="true"/>
            <element name="UIE_key" type="string" maxOccurs="1" minOccurs="0" default="default"/>
            <element name="UIE_capability" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_server_cert_path" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_server_url" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_root_key_type" type="string" maxOccurs="1" minOccurs="0" default="otp_oem"/>
            <element name="uie_key_switch_enable" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="oem_id_independent" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="revocation_enablement" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="activation_enablement" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="root_revoke_activate_enable" type="string" maxOccurs="1" minOccurs="0" default="disable"/>
            <element name="dsa_type" type="string" maxOccurs="1" minOccurs="0" default="rsa"/>
            <element name="ecdsa_curve" type="string" maxOccurs="1" minOccurs="0" default="secp384r1"/>
            <element name="multi_image_segment_addr" type="string" maxOccurs="1" minOccurs="0" />
            <element name="client_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="lib_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="image_entry" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_feature_id" type="string" maxOccurs="1" minOccurs="0" default="0x1" />
        </all>
    </complexType>

    <complexType name="complex_multi_serial_numbers">
        <sequence>
            <element name="serial" type="string" maxOccurs="200" minOccurs="0" />
        </sequence>
    </complexType>

    <complexType name="complex_parsegen">
        <all>
            <element name="image_types_list" type="tns:complex_image_types_list" maxOccurs="1" minOccurs="0"/>
        </all>
    </complexType>

    <complexType name="complex_image_types_list">
        <sequence>
            <element name="image_type" type="tns:complex_image_type" maxOccurs="unbounded" minOccurs="1" />
        </sequence>
    </complexType>

    <complexType name="complex_image_type">
        <all>
            <element name="file_type" type="string"/>
            <element name="mbn_properties" type="tns:complex_mbn_properties" maxOccurs="1" minOccurs="0" />
            <element name="elf_properties" type="tns:complex_elf_properties" maxOccurs="1" minOccurs="0" />
            <element name="ewm_properties" type="tns:complex_ewm_properties" maxOccurs="1" minOccurs="0" />
            <element name="pmbl_properties" type="tns:complex_pmbl_properties" maxOccurs="1" minOccurs="0" />
        </all>
        <attribute name="id" type="string" use="required" />
    </complexType>

    <complexType name="complex_mbn_properties">
        <all>
            <element name="header_size" type="int" />
        </all>
    </complexType>

    <complexType name="complex_pmbl_properties">
        <all>
            <element name="preamble_size" type="int" maxOccurs="1" minOccurs="0" />
            <element name="has_magic_num" type="boolean" />
            <element name="ota_enabled" type="boolean" />
            <element name="page_size" type="int" maxOccurs="1" minOccurs="0" />
            <element name="num_of_pages" type="int" maxOccurs="1" minOccurs="0" />
            <element name="min_size_with_pad" type="int" maxOccurs="1" minOccurs="0" />
        </all>
    </complexType>

    <complexType name="complex_elf_properties">
        <all>
            <element name="has_hash_table" type="boolean" maxOccurs="1" minOccurs="0" />
            <element name="has_multi_image_segment" type="boolean" maxOccurs="1" minOccurs="0" default="false"/>
            <element name="has_license_manager_segment" type="boolean" maxOccurs="1" minOccurs="0" default="false"/>
            <element name="has_sections" type="boolean" maxOccurs="1" minOccurs="0" default="false"/>
            <element name="persist_encr" type="boolean" maxOccurs="1" minOccurs="0" default="false"/>
            <element name="max_elf_segments" type="int" maxOccurs="1" minOccurs="0"/>
            <element name="image_type" type="int" />
            <element name="hash_seg_placement" type="string" maxOccurs="1" minOccurs="0" />
            <element name="validate_ph_addrs" type="boolean" maxOccurs="1" minOccurs="0" />
            <element name="validate_vir_addrs" type="boolean" maxOccurs="1" minOccurs="0" />
        </all>
    </complexType>

    <complexType name="complex_ewm_properties">
        <all>
            <element name="image_entry" type="string" />
            <element name="relocatable" type="boolean" />
        </all>
    </complexType>

    <complexType name="complex_signing">
        <all>
            <element name="signer_attributes" type="tns:complex_signer_attributes" />
        </all>
    </complexType>

    <complexType name="complex_oid">
        <attribute name="name" use="required">
            <simpleType>
                <restriction base="string">
                    <enumeration value="tcg"></enumeration>
                    <enumeration value="feature_id"></enumeration>
                </restriction>
            </simpleType>
        </attribute>
        <attribute name="min" type="string" />
        <attribute name="max" type="string" />
    </complexType>

    <complexType name="complex_signer_attributes">
        <all>
            <element name="cass_signer_attributes" type="tns:complex_cass_signer_attributes"
                maxOccurs="1" minOccurs="0" />
            <element name="remote_client_signer_attributes" type="tns:complex_remote_client_signer_attributes"
                maxOccurs="1" minOccurs="0" />
            <element name="remote_signer_attributes" type="tns:complex_remote_signer_attributes"
                maxOccurs="1" minOccurs="0" />
        </all>
    </complexType>

    <complexType name="complex_cass_signer_attributes">
        <all>
            <element name="server" type="tns:complex_server" maxOccurs="1" minOccurs="0" />
            <element name="user_identity" type="tns:complex_user_identity" />
        </all>
    </complexType>

    <complexType name="complex_remote_client_signer_attributes">
        <all>
            <element name="send_signing_overrides" type="boolean"/>
        </all>
    </complexType>

    <complexType name="complex_remote_signer_attributes">
        <all>
            <element name="allow_signing_overrides" type="boolean"/>
        </all>
    </complexType>

    <complexType name="complex_server">
        <all>
            <element name="host" type="string" />
            <element name="port" type="int" />
            <element name="trust_keystore" type="string" />
            <element name="trust_keystore_password" type="string" maxOccurs="1" minOccurs="0" />
            <element name="trust_keystore_type">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="JKS" />
                        <enumeration value="PKCS12" />
                    </restriction>
                </simpleType>
            </element>
            <element name="host_validation_mode" maxOccurs="1" minOccurs="0">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="TEST" />
                        <enumeration value="STAGE_PROD" />
                    </restriction>
                </simpleType>
            </element>
        </all>
    </complexType>

    <complexType name="complex_user_identity">
        <all>
            <element name="token_identity_slot" type="int" maxOccurs="1" minOccurs="0" />
            <element name="token_password" type="string" maxOccurs="1" minOccurs="0" />
            <element name="keystore_file" type="string" maxOccurs="1" minOccurs="0" />
            <element name="token_driver_home" type="tns:complex_token_driver_home" />
            <element name="keystore_type">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="PKCS11" />
                        <enumeration value="PKCS12" />
                    </restriction>
                </simpleType>
            </element>
        </all>
    </complexType>

    <complexType name="complex_token_driver_home">
        <all>
            <element name="windows" type="string" />
            <element name="linux" type="string" />
        </all>
    </complexType>

    <complexType name="complex_post_process">
        <all>
            <element name="pil_splitter" type="string" />
        </all>
    </complexType>

    <complexType name="complex_data_provisioning">
        <all>
            <element name="base_path" type="string" />
        </all>
    </complexType>

    <complexType name="complex_images_list">
        <sequence>
            <element name="image" type="tns:complex_image" maxOccurs="unbounded"
                minOccurs="1" />
        </sequence>
    </complexType>

    <complexType name="complex_image">
        <all>
            <element name="pil_split" type="boolean" maxOccurs="1" minOccurs="0" />
            <element name="general_properties_overrides" type="tns:complex_general_properties_overrides" />
            <element name="meta_build_location" type="string" maxOccurs="1" minOccurs="0" />
            <element name="post_process_commands" type="string" maxOccurs="1" minOccurs="0" />
        </all>
        <attribute name="sign_id" type="string" use="required" />
        <attribute name="name" type="string" use="optional" />
        <attribute name="image_type" type="string" use="required" />
        <attribute name="cert_config" type="string" use="optional" />
        <attribute name="output_file_name" type="string" use="optional" />
    </complexType>

    <complexType name="complex_general_properties_overrides">
        <all>
            <element name="selected_signer" type="string" maxOccurs="1" minOccurs="0" />
            <element name="selected_encryptor" type="string" maxOccurs="1" minOccurs="0"/>
            <element name="selected_cert_config" type="string" maxOccurs="1" minOccurs="0" />
            <element name="max_cert_size" type="int" maxOccurs="1" minOccurs="0" />
            <element name="key_size" type="int" maxOccurs="1" minOccurs="0" />
            <element name="num_certs_in_certchain" type="int" maxOccurs="1" minOccurs="0" />
            <element name="num_root_certs" type="int" maxOccurs="1" minOccurs="0" />
            <element name="max_num_root_certs" type="int" maxOccurs="1" minOccurs="0" />
            <element name="testsig_serialnum" type="string" maxOccurs="1" minOccurs="0" />
            <element name="mrc_index" type="int" maxOccurs="1" minOccurs="0" />
            <element name="msm_part" type="string" maxOccurs="1" minOccurs="0" />
            <element name="oem_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="model_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="sw_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="anti_rollback_version" type="string" maxOccurs="1" minOccurs="0" />
            <element name="app_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="crash_dump" type="string" maxOccurs="1" minOccurs="0" />
            <element name="rot_en" type="string" maxOccurs="1" minOccurs="0" />
            <element name="soc_hw_version" type="string" maxOccurs="1" minOccurs="0" />
            <element name="soc_vers" type="string" maxOccurs="1" minOccurs="0" />
            <element name="mask_soc_hw_version" type="string" maxOccurs="1" minOccurs="0" />
            <element name="in_use_soc_hw_version" type="string" maxOccurs="1" minOccurs="0" />
            <element name="use_serial_number_in_signing" type="string" maxOccurs="1" minOccurs="0" />
            <element name="serial_number" type="string" maxOccurs="1" minOccurs="0" />
            <element name="multi_serial_numbers" type="tns:complex_multi_serial_numbers" maxOccurs="1" minOccurs="0"/>
            <element name="debug" type="string" maxOccurs="1" minOccurs="0" />
            <element name="exponent" type="int" maxOccurs="1" minOccurs="0" />
            <element name="object_id" type="tns:complex_oid" maxOccurs="1" minOccurs="0" />
            <element name="pmbl_properties" type="tns:complex_pmbl_properties" maxOccurs="1" minOccurs="0" />
            <element name="cass_capability" type="string" maxOccurs="1" minOccurs="0" />
            <element name="hash_pageseg_as_segment" type="boolean" maxOccurs="1" minOccurs="0" />
            <element name="hash_algorithm" type="string" maxOccurs="1" minOccurs="0" />
            <element name="segment_hash_algorithm" type="string" maxOccurs="1" minOccurs="0" />
            <element name="cass_attest_cert" type="string" maxOccurs="1" minOccurs="0" />
            <element name="rsa_padding" type="string" maxOccurs="1" minOccurs="0" />
            <element name="hmac" type="boolean" maxOccurs="1" minOccurs="0" />
            <element name="secboot_version" type="string" maxOccurs="1" minOccurs="0" />
            <element name="qti_sign" type="boolean" maxOccurs="1" minOccurs="0" />
            <element name="oem_sign" type="boolean" maxOccurs="1" minOccurs="0" />
            <element name="UIE_key" type="string" maxOccurs="1" minOccurs="0" />	    
            <element name="UIE_capability" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_server_cert_path" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_server_url" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_root_key_type" type="string" maxOccurs="1" minOccurs="0" />
            <element name="uie_key_switch_enable" type="string" maxOccurs="1" minOccurs="0" />
            <element name="oem_id_independent" type="string" maxOccurs="1" minOccurs="0" />
            <element name="revocation_enablement" type="string" maxOccurs="1" minOccurs="0" />
            <element name="activation_enablement" type="string" maxOccurs="1" minOccurs="0" />
            <element name="root_revoke_activate_enable" type="string" maxOccurs="1" minOccurs="0" />
            <element name="dsa_type" type="string" maxOccurs="1" minOccurs="0" />
            <element name="ecdsa_curve" type="string" maxOccurs="1" minOccurs="0" />
            <element name="multi_image_segment_addr" type="string" maxOccurs="1" minOccurs="0" />
            <element name="client_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="lib_id" type="string" maxOccurs="1" minOccurs="0" />
            <element name="image_entry" type="string" maxOccurs="1" minOccurs="0" />
            <element name="UIE_feature_id" type="string" maxOccurs="1" minOccurs="0" />
        </all>
    </complexType>

</schema>
