26.42. kych-oid4vp(1)#
26.42.1. Name#
kych-oid4vp - OpenID4VP 1.0 verifier for EU Digital Identity Wallets, a KyCH-native helper
26.42.2. Synopsis#
kych-oid4vp [-c CONFIG] [-L LEVEL] [-v]
26.42.3. Description#
kych-oid4vp is KyCH’s own verifier for EU Digital Identity Wallets: it
asks a wallet for an EU PID – as an SD-JWT VC or as an ISO mdoc – over
OpenID for Verifiable Presentations 1.0, checks what the wallet presents,
and tells KyCH the outcome. It is one of the interchangeable helpers of the
eupid and eupid-mdoc vocabularies, beside the EUDI reference verifier
(eudi-verifier(1)) and walt.id’s (waltid-verifier(1)); KyCH talks to it
through the KyCH-native helper API (TYPE = kych-native in kych.conf(5)).
It does no cryptography of its own and takes no trust decision of its own:
the formats are checked by KyCH’s kych-vp-formats library, the trust by
kych-trust(1).
The daemon has two interfaces, on two listeners:
the management interface ([kych-oid4vp]), for KyCH alone: the
KyCH-native helper API, GET /config, POST /sessions, GET
/sessions/ID[?wait=SECONDS], DELETE /sessions/ID. Every request but
/config must carry Authorization: Bearer API_SECRET. It listens on a
Unix domain socket, /run/kych-oid4vp/api.sock (group kych-oid4vp),
or on a loopback address; any other address is refused.
the wallet interface ([kych-oid4vp-wallet]), which the reverse proxy
publishes at BASE_URL:
GETorPOSTBASE_URLrequest/TOKENThe signed request object of one session (JAR,
typoauth-authz-req+jwt), handed out once: whoever fetched it first is the only one who learns the response URI. A POST carries the wallet’swallet_metadataandwallet_nonce(OpenID4VP 1.0, section 5.10); the nonce is repeated in the object, the wallet metadata’sissuerbecomes itsaud.POSTBASE_URLresponse/TOKENThe wallet’s response,
direct_postordirect_post.jwt, at mostMAX_RESPONSE_BYTES.
The Debian package binds the wallet interface to
/run/kych-oid4vp-wallet.sock (group www-data) by the socket unit
kych-oid4vp.socket; nginx must proxy exactly those two paths to it, and
nothing else of it.
26.42.3.1. A session#
KyCH posts the DCQL query (one credential query per vocabulary, both PID encodings in one credential set), the trust class of each credential query (its
[trust-*]section’sCLASS), the expiry, its return URL and its notification URL. kych-oid4vp stores the session with a fresh nonce, state and – fordirect_post.jwt– an ephemeral P-256 key to which the response is to be encrypted, and answers with the authorization request URI:AUTHORIZATION_REQUEST_URIwithclient_id,request_uriandrequest_uri_method.The wallet fetches the request object: signed with the access certificate’s key (ES256), its chain as
x5c, the client identifierx509_hash:(the certificate’s hash; the HAIP profile) orx509_san_dns:(a DNS name of the certificate, whichBASE_URL’s host must be), the DCQL query,client_metadatawith the encryption key and the offeredA128GCM/A256GCM,expthe session’s expiry, and, if KyCH sent one, the registration certificate asverifier_info.The wallet posts its response, which is checked in this order – the first failure fails the session at once, with a reason (api-kych-helper.rst lists them):
the transport: a
direct_post.jwtresponse must be a JWE that decrypts with the session’s key, under an offered content encryption and itskid; a cleartext response to it, or an encrypted one todirect_post, fails (a wallet’s error response may come in the clear either way); a response overMAX_RESPONSE_BYTESis refused with 413 and fails the session too;state; then the wallet’s own error (access_denied), if it sent one;every presentation, by its credential query’s format. An SD-JWT VC: the issuer’s signature by its
x5cleaf,typ,issnamed by that certificate,exp/nbf, every disclosure’s digest (a changed or smuggled one fails), and the key-binding JWT – signed by the credential’scnfkey,noncethe session’s,audthe client identifier,iatno older thanKB_JWT_MAX_AGE,sd_hashover the presentation. An mdoc:issuerAuthby itsx5chainleaf, the MSO’s doctype, digest algorithm and validity, every data element’s digest, anddeviceSignatureby the MSO’s device key over the OpenID4VP SessionTranscript of this request (client id, nonce, the response key’s thumbprint, response URI);the issuer’s chain: kych-trust’s decision in the issuance context of the credential query’s class (
PID);the status list the credential names, if any: fetched with
Acceptapplication/statuslist+jwtfor an SD-JWT VC andapplication/statuslist+cwtfor an mdoc, its signature andsubchecked, its signer’s chain trusted by kych-trust in the revocation context (PIDStatus) – a list signed by anyone else is not believed, whatever it says – and the credential’s entry valid. A list that cannot be fetched or read fails the presentation;DCQL: the presentations answer their credential queries (
vctvalues or doctype, every requested claim or oneclaim_setsoption) and together meet the credential sets;replay: the digest of every presentation’s holder binding is remembered, and one accepted before fails the session.
The session ends
verified, with the disclosed claims and the evidence in KyCH’s own shape, orfailed. kych-oid4vp posts{"session_id"}to KyCH’s notification URL and wakes KyCH’s long polls; KyCH fetches the outcome.
A response after the session’s expiry is refused, and the session reports
expired. Sessions live in kych-oid4vp’s own PostgreSQL database
(schema kych_oid4vp; kych-oid4vp-dbinit(1), kych-oid4vp-dbconfig(1)), so
a restart of the daemon loses none. The disclosed claims, the evidence and
the response key are deleted PURGE_GRACE after KyCH first fetched the
outcome, or at the session’s expiry; the rows RETENTION after the
session ended. A sweeper runs every SWEEP_INTERVAL and also tells KyCH
of sessions that expired unanswered.
26.42.4. Options#
- -c CONFIG | –config=CONFIG
Use the configuration file CONFIG; see kych-oid4vp.conf(5).
- -L LEVEL | –log=LEVEL
Set the logging verbosity. Defaults to
INFO.- -v | –verbose
Also log what the libraries have to say.
- -h | –help
Print short help.
- –version
Print version information.
26.42.5. Files#
/etc/kych-oid4vp/kych-oid4vp.confThe configuration (root:kych-oid4vp 0640).
/etc/kych-oid4vp/secrets/api.secret.confAPI_SECRET, generated by the package on its first install; KyCH needs the same value./etc/kych-oid4vp/secrets/access-certificate.key.pem,/etc/kych-oid4vp/access-certificate.pemThe access certificate’s private key (PKCS#8) and its chain, leaf first.
/usr/share/kych-oid4vp/nginx/kych-oid4vp.confAn example nginx site: the wallet paths, and a loopback location for the notification to KyCH.
26.42.6. See Also#
kych-oid4vp.conf(5), kych-oid4vp-dbinit(1), kych-oid4vp-dbconfig(1), kych-trust(1), kych.conf(5), eudi-verifier(1), waltid-verifier(1).
26.42.7. Bugs#
Report bugs by using https://bugs.taler.net/ or by sending electronic mail to <taler@gnu.org>.