xml/schema/std.xsd
2019-12-08 15:00:22 -05:00

140 lines
5.5 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="http://schema.xml.r00t2.io/std.xsd"
xmlns="http://schema.xml.r00t2.io/std.xsd"
xmlns:std="http://schema.xml.r00t2.io/std.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<xs:simpleType name="t_UUID4">
<xs:restriction base="xs:token">
<xs:pattern value="[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="t_cksum">
<xs:simpleContent>
<xs:extension base="std:t_cksum_hashtypes">
<xs:attribute name="hashType" use="required" type="std:t_cksum_hashtypes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="t_cksum_file">
<xs:simpleContent>
<xs:extension base="std:t_uri">
<xs:attribute name="hashType" use="required" type="std:t_cksum_hashtypes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="t_cksum_hashtypes">
<xs:restriction base="xs:string">
<xs:enumeration value="adler32"/>
<xs:enumeration value="crc32"/>
<xs:enumeration value="md5"/>
<xs:enumeration value="sha1"/>
<xs:enumeration value="sha224"/>
<xs:enumeration value="sha256"/>
<xs:enumeration value="sha384"/>
<xs:enumeration value="sha512"/>
<xs:enumeration value="blake2b"/>
<xs:enumeration value="blake22"/>
<xs:enumeration value="sha3_224"/>
<xs:enumeration value="sha3_256"/>
<xs:enumeration value="sha3_384"/>
<xs:enumeration value="sha3_512"/>
<xs:enumeration value="shake_128"/>
<xs:enumeration value="shake_256"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="t_cmdopts">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" use="required" type="xs:token"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="t_epoch_or_iso">
<!-- positiveInteger is used for UNIX Epoch. -->
<xs:union memberTypes="xs:dateTime xs:positiveInteger"/>
</xs:simpleType>
<xs:complexType name="t_gpg_keys">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="keyID" minOccurs="1" maxOccurs="unbounded" type="std:t_gpg_key_id"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="t_gpg_key_id">
<xs:restriction base="xs:string">
<xs:pattern value="(auto|default)"/><!-- Program should accept any key IDs it finds (INSECURE) -->
<xs:pattern value="(0x)?[0-9A-Fa-f]{40}"/><!-- Full key ID -->
<xs:pattern value="(0x)?[0-9A-Fa-f]{16}"/><!-- Shorthand key ID -->
<xs:pattern value="(0x)?[0-9A-Fa-f]{8}"/><!-- Legacy shorter shorthand -->
<xs:pattern value="([0-9A-Fa-f ]{4}){5} ?([0-9A-Fa-f ]{4}){4}[0-9A-Fa-f]{4}"/><!-- Fingerprint -->
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_gpg_sig">
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_nonempty">
<xs:restriction base="xs:token">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_uri">
<xs:restriction base="xs:anyURI">
<xs:pattern value="(https?|ftps?|file)://.+"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="t_verifyfile">
<xs:all minOccurs="1">
<xs:element name="gpg" minOccurs="0" maxOccurs="1" type="std:t_verify_gpg">
<xs:unique name="uniq_gpg_sig">
<xs:selector xpath="std:signature"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniq_gpg_sigfile">
<xs:selector xpath="std:signatureFile"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
<xs:element name="hash" minOccurs="0" maxOccurs="1" type="std:t_verify_cksum"/>
</xs:all>
</xs:complexType>
<xs:complexType name="t_verify_cksum">
<xs:sequence>
<xs:element name="checksum" minOccurs="0" maxOccurs="unbounded" type="std:t_cksum"/>
<xs:element name="checksumFile" minOccurs="0" maxOccurs="unbounded" type="std:t_cksum_file"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="t_verify_gpg">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="signature" minOccurs="0" maxOccurs="unbounded" type="std:t_gpg_sig"/>
<xs:element name="signatureFile" minOccurs="0" maxOccurs="unbounded" type="std:t_uri"/>
<xs:element name="gpgKeyIDs" minOccurs="1" maxOccurs="1" type="std:t_gpg_keys">
<xs:unique name="uniq_key_id">
<xs:selector xpath="std:keyID"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:schema>