Skip to content

Commit

Permalink
Add additional TL types
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Dec 1, 2023
1 parent eab6161 commit 6eaa5cd
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 0 deletions.
66 changes: 66 additions & 0 deletions external-schemata/xsd/etsi/ts_119612_extra.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?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/02231/v2/additionaltypes#" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tslx="http://uri.etsi.org/02231/v2/additionaltypes#" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#"
xmlns:tsl="http://uri.etsi.org/02231/v2#" 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/02231/v2#" schemaLocation="ts_119612.xsd"/>
<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.3.13 Pointers to other TSLs</xsd:documentation>
</xsd:annotation>
<xsd:element name="MimeType" type="xsd:string"/>
<xsd:annotation>
<xsd:documentation>X509CertificateLocation element was specified in TS 102 231 v3.1.2 clause B.4.3 The
ServiceDigitalIdentityType. It is now deprecated and is not used
</xsd:documentation>
</xsd:annotation>
<xsd:element name="X509CertificateLocation" type="tsl:NonEmptyURIType"/>
<xsd:annotation>
<xsd:documentation>PublicKeyLocation element was specified in TS 102 231 v3.1.2 clause B.4.3 The
ServiceDigitalIdentityType. It is now deprecated and is not used
</xsd:documentation>
</xsd:annotation>
<xsd:element name="PublicKeyLocation" type="tsl:NonEmptyURIType"/>
<xsd:annotation>
<xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2.3 OtherCriteria, bullet 1) ExtendedKeyUsage
</xsd:documentation>
</xsd:annotation>
<xsd:element name="ExtendedKeyUsage" type="tslx:ExtendedKeyUsageType"/>
<xsd:complexType name="ExtendedKeyUsageType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="KeyPurposeId" type="xades:ObjectIdentifierType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:annotation>
<xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.3 TakenOverBy Extension</xsd:documentation>
</xsd:annotation>
<xsd:element name="TakenOverBy" type="tslx:TakenOverByType"/>
<xsd:complexType name="TakenOverByType">
<xsd:sequence>
<xsd:element name="URI" type="tsl:NonEmptyMultiLangURIType"/>
<xsd:element name="TSPName" type="tsl:InternationalNamesType"/>
<xsd:element ref="tsl:SchemeOperatorName"/>
<xsd:element ref="tsl:SchemeTerritory"/>
<xsd:element name="OtherQualifier" type="tsl:AnyType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:annotation>
<xsd:documentation>Specified in TS 119 612 v2.1.1 clause 5.5.9.2.2.3 OtherCriteria, bullet 2)
CertSubjectDNAttribute
</xsd:documentation>
</xsd:annotation>
<xsd:element name="CertSubjectDNAttribute" type="tslx:CertSubjectDNAttributeType"/>
<xsd:complexType name="CertSubjectDNAttributeType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="AttributeOID" type="xades:ObjectIdentifierType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
20 changes: 20 additions & 0 deletions pyhanko/generated/etsi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@
TSPServiceType,
TSPType,
)
from .ts_119612_extra import (
CertSubjectDNAttribute,
CertSubjectDNAttributeType,
ExtendedKeyUsage,
ExtendedKeyUsageType,
MimeType,
PublicKeyLocation,
TakenOverBy,
TakenOverByType,
X509CertificateLocation,
)
from .ts_119612_sie import (
CriteriaListType,
CriteriaListTypeassert,
Expand Down Expand Up @@ -359,6 +370,15 @@
"TrustServiceProviderListType",
"TrustServiceStatusList",
"TrustStatusListType",
"CertSubjectDNAttribute",
"CertSubjectDNAttributeType",
"ExtendedKeyUsage",
"ExtendedKeyUsageType",
"MimeType",
"PublicKeyLocation",
"TakenOverBy",
"TakenOverByType",
"X509CertificateLocation",
"CriteriaListType",
"CriteriaListTypeassert",
"KeyUsageBitType",
Expand Down
145 changes: 145 additions & 0 deletions pyhanko/generated/etsi/ts_119612_extra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
from dataclasses import dataclass, field
from typing import Optional, Tuple

from .ts_119612 import (
AnyType,
InternationalNamesType,
NonEmptyMultiLangURIType,
SchemeOperatorName,
)
from .xades import ObjectIdentifierType

__NAMESPACE__ = "http://uri.etsi.org/02231/v2/additionaltypes#"


@dataclass(frozen=True)
class MimeType:
class Meta:
namespace = "http://uri.etsi.org/02231/v2/additionaltypes#"

value: str = field(
default="",
metadata={
"required": True,
},
)


@dataclass(frozen=True)
class PublicKeyLocation:
class Meta:
namespace = "http://uri.etsi.org/02231/v2/additionaltypes#"

value: str = field(
default="",
metadata={
"required": True,
"min_length": 1,
},
)


@dataclass(frozen=True)
class X509CertificateLocation:
class Meta:
namespace = "http://uri.etsi.org/02231/v2/additionaltypes#"

value: str = field(
default="",
metadata={
"required": True,
"min_length": 1,
},
)


@dataclass(frozen=True)
class CertSubjectDNAttributeType:
attribute_oid: Tuple[ObjectIdentifierType, ...] = field(
default_factory=tuple,
metadata={
"name": "AttributeOID",
"type": "Element",
"namespace": "http://uri.etsi.org/02231/v2/additionaltypes#",
"min_occurs": 1,
},
)


@dataclass(frozen=True)
class ExtendedKeyUsageType:
key_purpose_id: Tuple[ObjectIdentifierType, ...] = field(
default_factory=tuple,
metadata={
"name": "KeyPurposeId",
"type": "Element",
"namespace": "http://uri.etsi.org/02231/v2/additionaltypes#",
"min_occurs": 1,
},
)


@dataclass(frozen=True)
class TakenOverByType:
uri: Optional[NonEmptyMultiLangURIType] = field(
default=None,
metadata={
"name": "URI",
"type": "Element",
"namespace": "http://uri.etsi.org/02231/v2/additionaltypes#",
"required": True,
},
)
tspname: Optional[InternationalNamesType] = field(
default=None,
metadata={
"name": "TSPName",
"type": "Element",
"namespace": "http://uri.etsi.org/02231/v2/additionaltypes#",
"required": True,
},
)
scheme_operator_name: Optional[SchemeOperatorName] = field(
default=None,
metadata={
"name": "SchemeOperatorName",
"type": "Element",
"namespace": "http://uri.etsi.org/02231/v2#",
"required": True,
},
)
scheme_territory: Optional[str] = field(
default=None,
metadata={
"name": "SchemeTerritory",
"type": "Element",
"namespace": "http://uri.etsi.org/02231/v2#",
"required": True,
},
)
other_qualifier: Tuple[AnyType, ...] = field(
default_factory=tuple,
metadata={
"name": "OtherQualifier",
"type": "Element",
"namespace": "http://uri.etsi.org/02231/v2/additionaltypes#",
},
)


@dataclass(frozen=True)
class CertSubjectDNAttribute(CertSubjectDNAttributeType):
class Meta:
namespace = "http://uri.etsi.org/02231/v2/additionaltypes#"


@dataclass(frozen=True)
class ExtendedKeyUsage(ExtendedKeyUsageType):
class Meta:
namespace = "http://uri.etsi.org/02231/v2/additionaltypes#"


@dataclass(frozen=True)
class TakenOverBy(TakenOverByType):
class Meta:
namespace = "http://uri.etsi.org/02231/v2/additionaltypes#"

0 comments on commit 6eaa5cd

Please sign in to comment.