xml/schema/lib/types/gpg.xsd

73 lines
3.2 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:include schemaLocation="./net.xsd"/>
<xs:include schemaLocation="./std.xsd"/>
<xs:simpleType name="t_gpg_key_id">
<xs:restriction base="xs:string">
<xs:pattern value="auto"/><!-- Program should use hardcoded default (POSSIBLY INSECURE) -->
<xs:pattern value="\s*(0x)?[0-9A-Fa-f]{40}\s*"/><!-- Full key ID -->
<xs:pattern value="\s*(0x)?[0-9A-Fa-f]{16}\s*"/><!-- Shorthand key ID ("keyid-format long") -->
<xs:pattern value="\s*(0x)?[0-9A-Fa-f]{8}\s*"/><!-- Legacy shorter shorthand ("keyid-format short") -->
<xs:pattern value="\s*([0-9A-Fa-f ]{4}){5} ?([0-9A-Fa-f ]{4}){4}[0-9A-Fa-f]{4}\s*"/><!-- Fingerprint -->
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_gpg_safe_key_id">
<xs:restriction base="xs:string">
<xs:pattern value="\s*(0x)?[0-9A-Fa-f]{40}\s*"/><!-- Full key ID -->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_gpg_key_id_search">
<xs:union memberTypes="t_gpg_key_id t_net_email_addr"/>
</xs:simpleType>
<xs:complexType name="t_gpg_keys">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="keyID" minOccurs="0" maxOccurs="unbounded" type="t_gpg_key_id"/>
<xs:element name="keyFile" minOccurs="0" maxOccurs="unbounded" type="t_net_generic_resource"/>
</xs:choice>
<xs:attribute name="detect" use="optional" default="false" type="xs:boolean"/>
</xs:complexType>
<xs:simpleType name="t_gpg_sig">
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="t_gpg_verify">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="sigs" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="signature" minOccurs="0" maxOccurs="unbounded" type="t_gpg_sig"/>
<xs:element name="signatureFile" minOccurs="0" maxOccurs="unbounded"
type="t_net_generic_resource"/>
</xs:choice>
</xs:complexType>
<xs:unique name="uniq_gpg_sig">
<xs:selector xpath="signature"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniq_gpg_sigfile">
<xs:selector xpath="signatureFile"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
<xs:element name="keys" minOccurs="1" maxOccurs="1" type="t_gpg_keys">
<xs:unique name="uniq_key_id">
<xs:selector xpath="keyID"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:schema>