tba-protocol-credential-iso-mdoc 0.4.0.dev2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,69 @@
1
+ from .compatibility import IsoMdocCompatibility, compatibility
2
+ from .features import FEATURES_BY_VERSION, supports
3
+ from .errors import IsoMdocProtocolError
4
+ from .migrations import migrate_document
5
+ from .issuance import MdocIssuerProvider
6
+ from .schemas import (
7
+ DeviceRequest,
8
+ DeviceResponse,
9
+ DeviceResponseStatus,
10
+ DocRequest,
11
+ IssuerSigned,
12
+ IssuerSignedItem,
13
+ ItemsRequest,
14
+ Mdoc,
15
+ MobileSecurityObject,
16
+ SessionTranscript,
17
+ ValidityInfo,
18
+ parse_device_request,
19
+ parse_device_response,
20
+ parse_issuer_signed,
21
+ parse_mdoc,
22
+ parse_mdoc_credential,
23
+ parse_mobile_security_object,
24
+ )
25
+ from .versions import (
26
+ CURRENT_VERSION,
27
+ VERSION_HISTORY,
28
+ IsoMdocRevision,
29
+ IsoMdocVersion,
30
+ select_version,
31
+ )
32
+ from .verification import MdocVerifierProvider
33
+
34
+ __all__ = [
35
+ "CURRENT_VERSION",
36
+ "CAPABILITY_REQUIREMENTS",
37
+ "DeviceRequest",
38
+ "DeviceResponse",
39
+ "DeviceResponseStatus",
40
+ "DocRequest",
41
+ "FEATURES_BY_VERSION",
42
+ "IssuerSigned",
43
+ "IssuerSignedItem",
44
+ "ItemsRequest",
45
+ "Mdoc",
46
+ "MdocIssuerProvider",
47
+ "MdocVerifierProvider",
48
+ "MobileSecurityObject",
49
+ "SessionTranscript",
50
+ "VERSION_HISTORY",
51
+ "ValidityInfo",
52
+ "IsoMdocCompatibility",
53
+ "IsoMdocProtocolError",
54
+ "IsoMdocRevision",
55
+ "IsoMdocVersion",
56
+ "compatibility",
57
+ "migrate_document",
58
+ "namespace_claims",
59
+ "parse_device_request",
60
+ "parse_device_response",
61
+ "parse_issuer_signed",
62
+ "parse_mdoc",
63
+ "parse_mdoc_credential",
64
+ "parse_mobile_security_object",
65
+ "select_version",
66
+ "supports",
67
+ ]
68
+ from .bindings import CAPABILITY_REQUIREMENTS
69
+ from .claims import namespace_claims
@@ -0,0 +1,9 @@
1
+ """Capability bindings required by the ISO mdoc protocol owner."""
2
+
3
+ CAPABILITY_REQUIREMENTS = (
4
+ "credential.issue.mdoc",
5
+ "credential.verify.mdoc",
6
+ "presentation.verify.mdoc",
7
+ )
8
+
9
+ __all__ = ["CAPABILITY_REQUIREMENTS"]
@@ -0,0 +1,12 @@
1
+ """ISO mdoc namespace claim material."""
2
+
3
+ from collections.abc import Mapping
4
+
5
+
6
+ def namespace_claims(value: Mapping[str, object]) -> dict[str, object]:
7
+ """Normalize one namespace without assigning issuer trust."""
8
+
9
+ return {str(name): claim for name, claim in value.items()}
10
+
11
+
12
+ __all__ = ["namespace_claims"]
@@ -0,0 +1,21 @@
1
+ from dataclasses import dataclass
2
+
3
+ from .versions import CURRENT_VERSION
4
+
5
+
6
+ @dataclass(frozen=True, slots=True)
7
+ class IsoMdocCompatibility:
8
+ source: str
9
+ target: str
10
+ compatible: bool
11
+
12
+
13
+ def compatibility(
14
+ source: str, target: str = CURRENT_VERSION.value
15
+ ) -> IsoMdocCompatibility:
16
+ return IsoMdocCompatibility(
17
+ source, target, source == target == CURRENT_VERSION.value
18
+ )
19
+
20
+
21
+ __all__ = ["IsoMdocCompatibility", "compatibility"]
@@ -0,0 +1,10 @@
1
+ """Versioned ISO mdoc protocol exports backed by deterministic layer-10 models."""
2
+
3
+ from tba_concrete_mdoc.device_request import (
4
+ DeviceRequest,
5
+ DocRequest,
6
+ ItemsRequest,
7
+ parse_device_request,
8
+ )
9
+
10
+ __all__ = ["DeviceRequest", "DocRequest", "ItemsRequest", "parse_device_request"]
@@ -0,0 +1,9 @@
1
+ """Versioned ISO mdoc protocol exports backed by deterministic layer-10 models."""
2
+
3
+ from tba_concrete_mdoc.device_response import (
4
+ DeviceResponse,
5
+ DeviceResponseStatus,
6
+ parse_device_response,
7
+ )
8
+
9
+ __all__ = ["DeviceResponse", "DeviceResponseStatus", "parse_device_response"]
@@ -0,0 +1,8 @@
1
+ """ISO mdoc protocol errors."""
2
+
3
+
4
+ class IsoMdocProtocolError(ValueError):
5
+ """Raised when an ISO mdoc structure violates the selected revision."""
6
+
7
+
8
+ __all__ = ["IsoMdocProtocolError"]
@@ -0,0 +1,15 @@
1
+ from .versions import CURRENT_VERSION, IsoMdocVersion
2
+
3
+
4
+ FEATURES_BY_VERSION = {
5
+ IsoMdocVersion.ISO_18013_5_2021.value: frozenset(
6
+ {"issuer-signed", "device-signed", "session-transcript", "cbor", "cose"}
7
+ )
8
+ }
9
+
10
+
11
+ def supports(feature: str, version: IsoMdocVersion = CURRENT_VERSION) -> bool:
12
+ return feature in FEATURES_BY_VERSION[version.value]
13
+
14
+
15
+ __all__ = ["FEATURES_BY_VERSION", "supports"]
@@ -0,0 +1,5 @@
1
+ """Protocol export for the injected ISO mdoc issuance provider."""
2
+
3
+ from tba_provider_mdoc_issuer import CanonicalCborEncoder, MdocIssuerProvider
4
+
5
+ __all__ = ["CanonicalCborEncoder", "MdocIssuerProvider"]
@@ -0,0 +1,9 @@
1
+ """Versioned ISO mdoc protocol exports backed by deterministic layer-10 models."""
2
+
3
+ from tba_concrete_mdoc.issuer_signed import (
4
+ IssuerSigned,
5
+ IssuerSignedItem,
6
+ parse_issuer_signed,
7
+ )
8
+
9
+ __all__ = ["IssuerSigned", "IssuerSignedItem", "parse_issuer_signed"]
@@ -0,0 +1,8 @@
1
+ """Versioned ISO mdoc protocol exports backed by deterministic layer-10 models."""
2
+
3
+ from tba_concrete_mdoc.mdoc import (
4
+ Mdoc,
5
+ parse_mdoc,
6
+ )
7
+
8
+ __all__ = ["Mdoc", "parse_mdoc"]
@@ -0,0 +1,12 @@
1
+ from typing import Mapping
2
+
3
+ from .versions import CURRENT_VERSION
4
+
5
+
6
+ def migrate_document(value: Mapping[str, object], *, source: str) -> dict[str, object]:
7
+ if source != CURRENT_VERSION.value:
8
+ raise ValueError(f"no ISO mdoc migration path from {source}")
9
+ return dict(value)
10
+
11
+
12
+ __all__ = ["migrate_document"]
@@ -0,0 +1,9 @@
1
+ """Versioned ISO mdoc protocol exports backed by deterministic layer-10 models."""
2
+
3
+ from tba_concrete_mdoc.mobile_security_object import (
4
+ MobileSecurityObject,
5
+ ValidityInfo,
6
+ parse_mobile_security_object,
7
+ )
8
+
9
+ __all__ = ["MobileSecurityObject", "ValidityInfo", "parse_mobile_security_object"]
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,41 @@
1
+ """Versioned ISO mdoc protocol exports backed by deterministic layer-10 models."""
2
+
3
+ from tba_concrete_mdoc.schemas import (
4
+ DeviceRequest,
5
+ DeviceResponse,
6
+ DeviceResponseStatus,
7
+ DocRequest,
8
+ IssuerSigned,
9
+ IssuerSignedItem,
10
+ ItemsRequest,
11
+ Mdoc,
12
+ MobileSecurityObject,
13
+ SessionTranscript,
14
+ ValidityInfo,
15
+ parse_device_request,
16
+ parse_device_response,
17
+ parse_issuer_signed,
18
+ parse_mdoc,
19
+ parse_mdoc_credential,
20
+ parse_mobile_security_object,
21
+ )
22
+
23
+ __all__ = [
24
+ "DeviceRequest",
25
+ "DeviceResponse",
26
+ "DeviceResponseStatus",
27
+ "DocRequest",
28
+ "IssuerSigned",
29
+ "IssuerSignedItem",
30
+ "ItemsRequest",
31
+ "Mdoc",
32
+ "MobileSecurityObject",
33
+ "SessionTranscript",
34
+ "ValidityInfo",
35
+ "parse_device_request",
36
+ "parse_device_response",
37
+ "parse_issuer_signed",
38
+ "parse_mdoc",
39
+ "parse_mdoc_credential",
40
+ "parse_mobile_security_object",
41
+ ]
@@ -0,0 +1,7 @@
1
+ """Versioned ISO mdoc protocol exports backed by deterministic layer-10 models."""
2
+
3
+ from tba_concrete_mdoc.session_transcript import (
4
+ SessionTranscript,
5
+ )
6
+
7
+ __all__ = ["SessionTranscript"]
@@ -0,0 +1,15 @@
1
+ """Protocol export for the injected ISO mdoc verification provider."""
2
+
3
+ from tba_provider_mdoc_verifier import (
4
+ CanonicalCborEncoder,
5
+ CborDecoder,
6
+ CosePayloadDecoder,
7
+ MdocVerifierProvider,
8
+ )
9
+
10
+ __all__ = [
11
+ "CanonicalCborEncoder",
12
+ "CborDecoder",
13
+ "CosePayloadDecoder",
14
+ "MdocVerifierProvider",
15
+ ]
@@ -0,0 +1,39 @@
1
+ from dataclasses import dataclass
2
+ from enum import StrEnum
3
+
4
+
5
+ class IsoMdocVersion(StrEnum):
6
+ ISO_18013_5_2021 = "ISO/IEC 18013-5:2021"
7
+
8
+
9
+ @dataclass(frozen=True, slots=True)
10
+ class IsoMdocRevision:
11
+ identifier: str
12
+ status: str
13
+ specification: str
14
+
15
+
16
+ CURRENT_VERSION = IsoMdocVersion.ISO_18013_5_2021
17
+ VERSION_HISTORY = {
18
+ CURRENT_VERSION.value: IsoMdocRevision(
19
+ CURRENT_VERSION.value,
20
+ "international-standard",
21
+ "ISO/IEC 18013-5:2021",
22
+ )
23
+ }
24
+
25
+
26
+ def select_version(value: str | IsoMdocVersion) -> IsoMdocVersion:
27
+ version = IsoMdocVersion(value)
28
+ if version.value not in VERSION_HISTORY:
29
+ raise ValueError(f"unsupported ISO mdoc revision: {value}")
30
+ return version
31
+
32
+
33
+ __all__ = [
34
+ "CURRENT_VERSION",
35
+ "VERSION_HISTORY",
36
+ "IsoMdocRevision",
37
+ "IsoMdocVersion",
38
+ "select_version",
39
+ ]
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-protocol-credential-iso-mdoc
3
+ Version: 0.4.0.dev2
4
+ Summary:
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10,<3.15
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Requires-Dist: tba-bases-digital-credential (==0.4.0.dev2)
14
+ Requires-Dist: tba-concrete-mdoc (==0.4.0.dev2)
15
+ Requires-Dist: tba-concrete-mdoc-credential (==0.4.0.dev2)
16
+ Requires-Dist: tba-contracts-identity (==0.4.0.dev2)
17
+ Requires-Dist: tba-provider-mdoc-issuer (==0.4.0.dev2)
18
+ Requires-Dist: tba-provider-mdoc-verifier (==0.4.0.dev2)
@@ -0,0 +1,21 @@
1
+ tba_protocol_credential_iso_mdoc/__init__.py,sha256=qVnKCz8iAlcxJ6IXwjpIe60tqJv6BSrofEdwqYTxLyI,1679
2
+ tba_protocol_credential_iso_mdoc/bindings.py,sha256=zb1kyCWYKtoUa4fnFq6ssTVEteXVaPlie8j2s5WQNHo,228
3
+ tba_protocol_credential_iso_mdoc/claims.py,sha256=L6-ftuyTKm6IizrOi4LZ-hFLymCtEbE8zVmBW8WXwbI,315
4
+ tba_protocol_credential_iso_mdoc/compatibility.py,sha256=BKzIEqJ_-Q3A3XfwDJa8P1CPjmzfe_KCJ7ET_iFCMNs,452
5
+ tba_protocol_credential_iso_mdoc/device_request.py,sha256=pPeoY0KMFuJnAb-2X_RaQs9DkIYPse4yvtIXIR8DxUo,295
6
+ tba_protocol_credential_iso_mdoc/device_response.py,sha256=oKPishYNzK3sJWdB7z9by4yHY2FbhM3QgdcxvsnrMB8,286
7
+ tba_protocol_credential_iso_mdoc/errors.py,sha256=j-ezWqdSzsAkHpU3cvLCAHGxNkE0sU9d5CogAVXFqjc,187
8
+ tba_protocol_credential_iso_mdoc/features.py,sha256=V039K62wvt9ui5wvhxTwLIzXV7ejqDZ9IAGmQw58sC8,409
9
+ tba_protocol_credential_iso_mdoc/issuance.py,sha256=EuMdAtFWYHSON2YFCWlD3OuiXWbUAxJNb8kLQg_lNvI,204
10
+ tba_protocol_credential_iso_mdoc/issuer_signed.py,sha256=dAgkD_r22-dDXzc_5GrSVDCvq1T8aIQldxKTtzqumEQ,268
11
+ tba_protocol_credential_iso_mdoc/mdoc.py,sha256=l7aAKKIwssc2wsLO4MQPnjxX4sqj2igYP8u9kcGWBIk,183
12
+ tba_protocol_credential_iso_mdoc/migrations.py,sha256=6PiyLdOcHr-6o_hy76XwPzfxUNNTFDQn73wfMp8S_Xo,322
13
+ tba_protocol_credential_iso_mdoc/mobile_security_object.py,sha256=X7b-j9C3uSo2rrxGvNH-r_vbJaqfYXrdBjGhNypZsSA,303
14
+ tba_protocol_credential_iso_mdoc/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
15
+ tba_protocol_credential_iso_mdoc/schemas.py,sha256=7035AeCbllB3sj2qNAwoOtGv2ub4rxjgUXNnZgV9uu4,917
16
+ tba_protocol_credential_iso_mdoc/session_transcript.py,sha256=l52AdU4-0ngBUQveZCYmFXI6V-wVZ-wXG5o10PZBs0o,193
17
+ tba_protocol_credential_iso_mdoc/verification.py,sha256=uBFpB-1WtPhOujNr3VOrZ6zV6iW3af55IYhrodRGjew,324
18
+ tba_protocol_credential_iso_mdoc/versions.py,sha256=OhOQxzaPo2MarXpL0e1TJ-Ti3z_o6zjR55bFhQLgM0c,845
19
+ tba_protocol_credential_iso_mdoc-0.4.0.dev2.dist-info/METADATA,sha256=imzlZvdgUhW9AisZ2K1hLrIRtjg3I3mkT3ktDifLKFU,786
20
+ tba_protocol_credential_iso_mdoc-0.4.0.dev2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
21
+ tba_protocol_credential_iso_mdoc-0.4.0.dev2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.5.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any