EU Trusted Lists
openvc.trustlist consumes the EU List of Trusted Lists (LOTL) and the national
Trusted Lists it points at (eIDAS 2.0 / EUDI, ETSI TS 119 612) as a source of
X.509 trust anchors for the verifier. walk_lotl(...) returns a
TrustAnchorSet whose .certificates feed the existing X.509 path directly — it
adds no verification surface; openvc.x5c stays the path validator.
from openvc import verify_credential
from openvc.trustlist import walk_lotl, verify_xades_enveloped
from openvc.fetch import https_bytes_fetch
anchors = walk_lotl(
"https://ec.europa.eu/tools/lotl/eu-lotl.xml",
lotl_signer_certs=[commission_cert], # caller-pinned root — no implicit trust
verify_signature=verify_xades_enveloped, # the [trustlist] extra's XAdES verifier
fetch=https_bytes_fetch)
verify_credential(vc, x5c_trust_anchors=anchors.certificates)
Trust is caller-pinned (the LOTL signer certs), fail-closed (a list that
cannot be fetched, verified, or is expired contributes zero anchors and is recorded
in problems), and selective (default: granted qualified-CA services). XML
parsing is hardened stdlib (no DTD/XXE, bounded). XML-signature (XAdES) verification
is an injected callback kept out of core: install openvc-core[trustlist] for
the reference verify_xades_enveloped (signxml), or inject your own. See
ADR-0003.
openvc.trustlist
openvc.trustlist — consume EU trusted lists as a verifier X.509 trust-anchor source (eIDAS 2.0 / EUDI): one interface, two encodings.
- ETSI TS 119 612 XML Trusted Lists (LOTL → national TL): :func:
walk_lotl. - ETSI TS 119 602 JSON Lists of Trusted Entities (LoTE), the successor data
model whose EU profiles carry the EUDI wallet anchor lists — Annex F (WRPAC
providers) and Annex G (WRPRC providers): :func:
walk_lote.
Both distil into the same :class:TrustAnchorSet; its .certificates feed
the existing X.509 path directly:
from openvc import verify_credential
from openvc.trustlist import walk_lotl
from openvc.fetch import https_bytes_fetch
anchors = walk_lotl(
"https://ec.europa.eu/tools/lotl/eu-lotl.xml",
lotl_signer_certs=[commission_cert], # caller-pinned root (no implicit trust)
verify_signature=my_xades_verifier, # injected, fail-closed
fetch=https_bytes_fetch)
verify_credential(vc, x5c_trust_anchors=anchors.certificates)
This adds no verification surface — :mod:openvc.x5c remains the path validator;
trust lists only tell it which roots are EU-recognised. XML parsing is hardened
stdlib (no DTD/XXE, bounded) with XML-signature verification an injected
callback (the [trustlist] extra ships a reference XAdES one); the LoTE lane
is signed as compact JAdES and verifies on the library's own JOSE primitives, no
extra needed. See docs/adr/ADR-0003-eu-trusted-lists.md and
:mod:openvc.trustlist.lote.
Select
dataclass
A filter over trust services. A None facet matches everything; a set
restricts to its members. The default (see :data:DEFAULT_SELECT) keeps
granted qualified-CA services — the ones that issue EUDI issuer certs.
Source code in src/openvc/trustlist/consume.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
ServiceStatus
ETSI TS 119 612 ServiceStatus URIs (the ones a verifier usually gates on).
Source code in src/openvc/trustlist/consume.py
42 43 44 45 46 | |
ServiceType
ETSI TS 119 612 ServiceTypeIdentifier URIs.
A convenience set of the identifiers observed on the live EU Trusted Lists under
TLv6 (ETSI TS 119 612 v2.4.1, mandatory since 29 Apr 2026). These are just
names — :class:Select matches ServiceTypeIdentifier verbatim, so any URI
works, including the EUDI-wallet trust services (issuance of QEAA / EAA / PuB-EAA,
qualified electronic ledgers) that v2.4.1 introduces but national lists have not
widely populated yet: pass their URI to :class:Select as it rolls out.
Source code in src/openvc/trustlist/consume.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
TrustListError
Bases: OpenvcError
Base class for every Trusted List failure.
Source code in src/openvc/trustlist/errors.py
7 8 | |
TrustListParseError
Bases: TrustListError
The Trusted List XML is malformed, oversize, or carries a forbidden construct (a DTD/DOCTYPE — an XXE / entity-expansion vector).
Source code in src/openvc/trustlist/errors.py
11 12 13 | |
TrustListProfileError
Bases: TrustListError
A verified, well-formed LoTE does not conform to the requested profile
(ETSI TS 119 602 clause 4.7 — e.g. the Annex F/G EU WRPAC/WRPRC providers
lists): wrong LoTEType, a forbidden component present, a service type
outside the profile's exclusive set, or an update window over the ceiling.
Fail-closed: a non-conformant list contributes no anchors.
Source code in src/openvc/trustlist/errors.py
29 30 31 32 33 34 | |
TrustListSignatureBackendUnavailable
Bases: TrustListSignatureUnavailable
XAdES signature verification was requested (via the reference
:func:openvc.trustlist.verify_xades_enveloped) but the [trustlist] extra
(signxml) is not installed (pip install openvc-core[trustlist]). A
subclass of :class:TrustListSignatureUnavailable: no verifier is available, so
a list is still never trusted unverified.
Source code in src/openvc/trustlist/errors.py
37 38 39 40 41 42 | |
TrustListSignatureError
Bases: TrustListError
The Trusted List's signature (XML XAdES, or a LoTE's compact JAdES) did not verify against the expected signer certificate(s) — the list is not authentic.
Source code in src/openvc/trustlist/errors.py
23 24 25 26 | |
TrustListSignatureUnavailable
Bases: TrustListError
A Trusted List had to be verified but no verify_signature callback was
supplied (fail-closed — a list is never trusted unverified). Pass the reference
:func:openvc.trustlist.verify_xades_enveloped (pip install
openvc-core[trustlist]), or inject your own.
Source code in src/openvc/trustlist/errors.py
16 17 18 19 20 | |
LoteProfile
dataclass
A LoTE profile (TS 119 602 clause 4.7): scheme-defined constraints a
specific list must satisfy on top of the general data model. Checking a list
against a profile is a conformance gate — every mismatch fails closed as
:class:~openvc.trustlist.errors.TrustListProfileError.
service_types is the profile's exclusive set (every service in the
list must use one of them); anchor_service_types is the least-privilege
subset a profiled :func:walk_lote keeps by default — the issuance
services. Under Annex F/G both an issuance and a revocation service become
list entries, but only the issuance certificates should anchor credential
verification (the adversarial review's M1: without the split, a registrar's
revocation-service key would validate WRPRC chains).
Source code in src/openvc/trustlist/lote.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
LoteServiceType
The ServiceTypeIdentifier URIs of the WRPAC / WRPRC providers-list
profiles (TS 119 602 Tables F.3 / G.3) — each profile uses its pair "to the
exclusion of any other".
Source code in src/openvc/trustlist/lote.py
100 101 102 103 104 105 106 107 | |
LoteType
The EU LoTEType URIs of TS 119 602 clause C.2.1.
Source code in src/openvc/trustlist/lote.py
90 91 92 93 94 95 96 97 | |
TrustAnchorSet
dataclass
The result of a LOTL→TL walk: the anchors that verified + the problems.
Source code in src/openvc/trustlist/model.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
certificates
property
The bare x509.Certificate anchors — pass straight to
verify_credential(..., x5c_trust_anchors=...). Deduplicated by DER.
x509_hashes
property
The HAIP x509_hash (hex SHA-256) of every anchor certificate.
TrustList
dataclass
A parsed ETSI TS 119 612 Trusted List — the LOTL (pointers) or a national
TL (providers).
Source code in src/openvc/trustlist/model.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
is_lotl
property
Whether this is the List of Trusted Lists (by TSLType).
TrustListProblem
dataclass
Why a TL (or the LOTL) contributed no anchors — surfaced, never silent.
Source code in src/openvc/trustlist/model.py
77 78 79 80 81 82 | |
TrustServiceAnchor
dataclass
One trust-service X.509 certificate with the metadata that lets a verifier decide whether to trust it (service type, status, provider, territory).
Source code in src/openvc/trustlist/model.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
sha256
property
The hex SHA-256 of the certificate DER — HAIP x509_hash for this anchor.
TrustServiceProvider
dataclass
A Trust Service Provider and its services (national TL entry).
Source code in src/openvc/trustlist/model.py
50 51 52 53 54 | |
TslPointer
dataclass
One OtherTSLPointer in the LOTL: where a national TL lives and the
certificate(s) that TL's XML signature must verify against (the LOTL vouches
for these — ADR-0003 D5).
Source code in src/openvc/trustlist/model.py
20 21 22 23 24 25 26 27 28 29 | |
consume_trust_list(xml, *, verify_signature, expected_signer_certs, max_bytes=DEFAULT_MAX_BYTES)
Verify a TL's XML signature (fail-closed) then parse it into a
:class:TrustList.
verify_signature is handed the raw bytes and expected_signer_certs and must
raise on any failure; if it is None this raises
:class:TrustListSignatureUnavailable — a list is never parsed-and-trusted
unverified. Signature verification runs before parsing so an unauthentic list is
rejected outright.
Source code in src/openvc/trustlist/consume.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
default_trust_list_fetch(url)
The blessed SSRF-guarded TL fetch: :func:openvc.fetch.https_bytes_fetch with a
TL-sized byte cap (national TLs run to a few MB).
Source code in src/openvc/trustlist/consume.py
102 103 104 105 106 | |
walk_lotl(lotl_url, *, lotl_signer_certs, verify_signature, fetch=default_trust_list_fetch, select=DEFAULT_SELECT, now=None, max_bytes=DEFAULT_MAX_BYTES)
Walk the LOTL at lotl_url down to each national TL and return the selected X.509 trust anchors.
Trust is rooted in lotl_signer_certs (the caller-pinned Commission keys). Each
TL's XML signature is verified via verify_signature (fail-closed). select
filters the trust services (default: granted qualified-CA — pass None for
all); fetch performs the SSRF-guarded GETs. A TL that cannot be fetched /
verified / is expired contributes no anchors and is recorded in the result's
problems — never silently trusted (ADR-0003 D6). Pass now to pin the
expiry evaluation instant.
Source code in src/openvc/trustlist/consume.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
consume_lote(token, *, expected_signer_certs, profile=None, now=None, max_bytes=DEFAULT_MAX_BYTES)
Verify a signed LoTE (compact JAdES baseline B) then parse it.
In order: the compact-JWS envelope (the {ES256, ES384, EdDSA, Ed25519}
allow-list applied before any crypto; a fail-closed allow-listed crit;
x5c required); the signer authenticated against expected_signer_certs
— the leaf matching a pinned certificate byte-for-byte (within that
certificate's own validity window), or path-validating to the pinned set as
anchors; the signature against the leaf key; the strict payload parse;
clause 6.8's DN binding (signing-certificate organizationName must be a
SchemeOperatorName value, countryName the SchemeTerritory when
the list carries one); and, when profile is given, the profile's
conformance gate (:class:TrustListProfileError on any mismatch).
There is no implicit trust root: expected_signer_certs are
cryptography x509.Certificate objects the caller pins (or, on a
pointer walk, the certificates the pointing list vouched for).
consume_lote establishes authenticity and conformance — not
freshness: staging an expired or closed list (NextUpdate in the
past, or null per clause 6.3.15) is :func:walk_lote's job, mirroring the
119 612 lane's consume_trust_list/walk_lotl split. A caller using
consume_lote directly must check next_update itself.
Source code in src/openvc/trustlist/lote.py
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | |
default_lote_fetch(url)
The blessed SSRF-guarded LoTE fetch: :func:openvc.fetch.https_bytes_fetch
with the trust-list byte cap.
Source code in src/openvc/trustlist/lote.py
163 164 165 166 167 | |
parse_lote(payload, *, max_bytes=DEFAULT_MAX_BYTES)
Parse a TS 119 602 JSON LoTE document into a :class:TrustList —
strictly, fail-closed, WITHOUT any signature verification (use
:func:consume_lote, which verifies first).
Accepts the decoded top-level object ({"LoTE": …}) or raw JSON bytes.
Raises :class:TrustListParseError on any structural violation.
Source code in src/openvc/trustlist/lote.py
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | |
walk_lote(lote_url, *, lote_signer_certs, profile=None, fetch=default_lote_fetch, select=_DERIVED_SELECT, now=None, max_bytes=DEFAULT_MAX_BYTES, max_lists=8)
Fetch, verify and distil the LoTE at lote_url (plus one hop of pointed
lists) into a :class:TrustAnchorSet.
Trust is rooted in lote_signer_certs (caller-pinned — for the EU lists,
the Commission's published list-signing certificates). The root list is
verified with :func:consume_lote under profile. Pointed lists follow
the clause 6.3.13 vouching model (one hop, like
:func:~openvc.trustlist.walk_lotl): each is verified against the
certificates its pointer vouched for — and, in a profiled walk, a
pointer is only followed when its qualifier LoTEType matches the
profile, and the pointed list must conform to the same profile, so a
foreign list type can never leak anchors into a profiled walk. A list that
cannot be fetched, verified, parsed, is expired, or is closed
(NextUpdate null, clause 6.3.15) contributes zero anchors and is
recorded in problems — never silently trusted, never aborting the walk.
select defaults to the profile's anchor service types — the issuance
services only (least privilege: under Annex F/G a provider's revocation
service is also listed, but its certificates must not anchor credential
verification). With no profile, the default keeps everything (the EU
profiles forbid ServiceStatus, so the 119 612 lane's granted-status
default would drop every anchor). Pass an explicit :class:Select to
filter differently, or select=None for every admitted anchor.
max_lists caps the total lists consumed (root + pointed).
Source code in src/openvc/trustlist/lote.py
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | |
parse_trust_list(xml, *, max_bytes=DEFAULT_MAX_BYTES)
Parse a Trusted List (or the LOTL) XML document into a :class:TrustList.
Hardened against XXE / entity-expansion (no DTD) and oversize input. Raises
:class:TrustListParseError on malformed, oversize, or DTD-bearing XML.
Source code in src/openvc/trustlist/parse.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
verify_xades_enveloped(xml, signer_certs, *, max_bytes=DEFAULT_MAX_BYTES)
Verify a Trusted List's enveloped XAdES / XML-DSig signature against
signer_certs, returning None on success and raising on any failure — the
exact shape :func:openvc.trustlist.walk_lotl's verify_signature expects.
The signature must verify against one of signer_certs (the certificates the
parent list vouched for); each is tried in turn and the first that verifies wins.
Accepted signature shapes: plain enveloped XML-DSig (one Reference over the
document) and XAdES-BASELINE (document + the signature's own SignedProperties,
optionally a co-signed ds:KeyInfo) — the shape real EU trusted lists carry.
Raises :class:TrustListSignatureError on a bad/absent signature, tampered
content, a DTD-bearing document, oversize input, unexpected signed references,
or no matching signer; :class:TrustListSignatureBackendUnavailable if the
[trustlist] extra (signxml) is not installed.
Source code in src/openvc/trustlist/xades.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |