Skip to content

Commit

Permalink
Add SIE XSD definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Nov 22, 2023
1 parent 67649bd commit 0efed44
Show file tree
Hide file tree
Showing 3 changed files with 305 additions and 2 deletions.
92 changes: 92 additions & 0 deletions external-schemata/xsd/etsi/ts_119612_sie.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ****** NOTICE ******
This document is part of ETSI TS 119 612. In the event that any
part of this document in conflict with the text of TS 119 612
then that text shall prevail as the authoritative source
-->
<xsd:schema targetNamespace="http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#" xmlns:tsl="http://uri.etsi.org/02231/v2#" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="xades.xsd"/>
<xsd:annotation><xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2 Qualifications Extension</xsd:documentation></xsd:annotation>
<xsd:element name="Qualifications" type="tns:QualificationsType"/>
<xsd:complexType name="QualificationsType">
<xsd:sequence maxOccurs="unbounded">
<!--Specified in TS 119 612 v2.1.1 clause 5.5.9.2.1 QualificationElement-->
<xsd:element name="QualificationElement" type="tns:QualificationElementType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:annotation><xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2.1 QualificationElement</xsd:documentation></xsd:annotation>
<xsd:complexType name="QualificationElementType">
<xsd:sequence>
<!--Specified in TS 119 612 v2.1.1 clause 5.5.9.2.3 Qualifier-->
<xsd:element name="Qualifiers" type="tns:QualifiersType"/>
<!--Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2 CriteriaList-->
<xsd:element name="CriteriaList" type="tns:CriteriaListType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:annotation>
<xsd:documentation>Please first try to use the CriteriaList before doing the OtherCriteria extension point.</xsd:documentation>
</xsd:annotation>
<xsd:annotation><xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2 CriteriaList</xsd:documentation></xsd:annotation>
<xsd:complexType name="CriteriaListType">
<xsd:sequence>
<!--Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2.1 KeyUsage-->
<xsd:element name="KeyUsage" type="tns:KeyUsageType" minOccurs="0" maxOccurs="unbounded"/>
<!--Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2.2 PolicySet-->
<xsd:element name="PolicySet" type="tns:PoliciesListType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="CriteriaList" type="tns:CriteriaListType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="otherCriteriaList" type="xades:AnyType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="assert">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="all"/>
<xsd:enumeration value="atLeastOne"/>
<xsd:enumeration value="none"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:annotation><xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2.3 Qualifier</xsd:documentation></xsd:annotation>
<xsd:complexType name="QualifiersType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="Qualifier" type="tns:QualifierType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="QualifierType">
<xsd:attribute name="uri" type="anyURI"/>
</xsd:complexType>
<xsd:annotation><xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2.2 PolicySet</xsd:documentation></xsd:annotation>
<xsd:complexType name="PoliciesListType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="PolicyIdentifier" type="xades:ObjectIdentifierType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:annotation><xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2.1 KeyUsage</xsd:documentation></xsd:annotation>
<xsd:complexType name="KeyUsageType">
<xsd:sequence maxOccurs="9">
<xsd:element name="KeyUsageBit" type="tns:KeyUsageBitType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="KeyUsageBitType">
<xsd:simpleContent>
<xsd:extension base="xsd:boolean">
<xsd:attribute name="name">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="digitalSignature"/>
<xsd:enumeration value="nonRepudiation"/>
<xsd:enumeration value="keyEncipherment"/>
<xsd:enumeration value="dataEncipherment"/>
<xsd:enumeration value="keyAgreement"/>
<xsd:enumeration value="keyCertSign"/>
<xsd:enumeration value="crlSign"/>
<xsd:enumeration value="encipherOnly"/>
<xsd:enumeration value="decipherOnly"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>
30 changes: 28 additions & 2 deletions pyhanko/generated/etsi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@
TSPServiceType,
TSPType,
)
from .ts_119612_sie import (
CriteriaListType,
CriteriaListTypeassert,
KeyUsageBitType,
KeyUsageBitTypename,
KeyUsageType,
PoliciesListType,
QualificationElementType,
Qualifications,
QualificationsType,
QualifiersType,
)
from .ts_119612_sie import QualifierType as Ts119612sieQualifierType
from .ts_11910202 import (
AdditionalValidationReportDataType,
AttributeBaseType,
Expand Down Expand Up @@ -178,7 +191,9 @@
OtherCertStatusValuesType,
OtherTimeStamp,
OtherTimeStampType,
QualifierType,
)
from .xades import QualifierType as XadesQualifierType
from .xades import (
QualifyingProperties,
QualifyingPropertiesReference,
QualifyingPropertiesReferenceType,
Expand Down Expand Up @@ -344,6 +359,17 @@
"TrustServiceProviderListType",
"TrustServiceStatusList",
"TrustStatusListType",
"CriteriaListType",
"CriteriaListTypeassert",
"KeyUsageBitType",
"KeyUsageBitTypename",
"KeyUsageType",
"PoliciesListType",
"QualificationElementType",
"Qualifications",
"QualificationsType",
"Ts119612sieQualifierType",
"QualifiersType",
"AllDataObjectsTimeStamp",
"Anytype",
"XadesAnyType",
Expand Down Expand Up @@ -394,7 +420,7 @@
"OtherCertStatusValuesType",
"OtherTimeStamp",
"OtherTimeStampType",
"QualifierType",
"XadesQualifierType",
"QualifyingProperties",
"QualifyingPropertiesReference",
"QualifyingPropertiesReferenceType",
Expand Down
185 changes: 185 additions & 0 deletions pyhanko/generated/etsi/ts_119612_sie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional, Tuple

from .xades import AnyType, ObjectIdentifierType

__NAMESPACE__ = (
"http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#"
)


class CriteriaListTypeassert(Enum):
ALL = "all"
AT_LEAST_ONE = "atLeastOne"
NONE = "none"


class KeyUsageBitTypename(Enum):
DIGITAL_SIGNATURE = "digitalSignature"
NON_REPUDIATION = "nonRepudiation"
KEY_ENCIPHERMENT = "keyEncipherment"
DATA_ENCIPHERMENT = "dataEncipherment"
KEY_AGREEMENT = "keyAgreement"
KEY_CERT_SIGN = "keyCertSign"
CRL_SIGN = "crlSign"
ENCIPHER_ONLY = "encipherOnly"
DECIPHER_ONLY = "decipherOnly"


@dataclass(frozen=True)
class QualifierType:
uri: Optional[str] = field(
default=None,
metadata={
"type": "Attribute",
},
)


@dataclass(frozen=True)
class KeyUsageBitType:
value: Optional[bool] = field(
default=None,
metadata={
"required": True,
},
)
name: Optional[KeyUsageBitTypename] = field(
default=None,
metadata={
"type": "Attribute",
},
)


@dataclass(frozen=True)
class PoliciesListType:
policy_identifier: Tuple[ObjectIdentifierType, ...] = field(
default_factory=tuple,
metadata={
"name": "PolicyIdentifier",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
"min_occurs": 1,
},
)


@dataclass(frozen=True)
class QualifiersType:
qualifier: Tuple[QualifierType, ...] = field(
default_factory=tuple,
metadata={
"name": "Qualifier",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
"min_occurs": 1,
},
)


@dataclass(frozen=True)
class KeyUsageType:
key_usage_bit: Tuple[KeyUsageBitType, ...] = field(
default_factory=tuple,
metadata={
"name": "KeyUsageBit",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
"min_occurs": 1,
"max_occurs": 9,
},
)


@dataclass(frozen=True)
class CriteriaListType:
key_usage: Tuple[KeyUsageType, ...] = field(
default_factory=tuple,
metadata={
"name": "KeyUsage",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
},
)
policy_set: Tuple[PoliciesListType, ...] = field(
default_factory=tuple,
metadata={
"name": "PolicySet",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
},
)
criteria_list: Tuple["CriteriaListType", ...] = field(
default_factory=tuple,
metadata={
"name": "CriteriaList",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
},
)
description: Optional[str] = field(
default=None,
metadata={
"name": "Description",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
},
)
other_criteria_list: Optional[AnyType] = field(
default=None,
metadata={
"name": "otherCriteriaList",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
},
)
assert_value: Optional[CriteriaListTypeassert] = field(
default=None,
metadata={
"name": "assert",
"type": "Attribute",
},
)


@dataclass(frozen=True)
class QualificationElementType:
qualifiers: Optional[QualifiersType] = field(
default=None,
metadata={
"name": "Qualifiers",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
"required": True,
},
)
criteria_list: Optional[CriteriaListType] = field(
default=None,
metadata={
"name": "CriteriaList",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
"required": True,
},
)


@dataclass(frozen=True)
class QualificationsType:
qualification_element: Tuple[QualificationElementType, ...] = field(
default_factory=tuple,
metadata={
"name": "QualificationElement",
"type": "Element",
"namespace": "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#",
"min_occurs": 1,
},
)


@dataclass(frozen=True)
class Qualifications(QualificationsType):
class Meta:
namespace = "http://uri.etsi.org/TrstSvc/SvcInfoExt/eSigDir-1999-93-EC-TrustedList/#"

0 comments on commit 0efed44

Please sign in to comment.