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:

GET or POST BASE_URLrequest/TOKEN

The signed request object of one session (JAR, typ oauth-authz-req+jwt), handed out once: whoever fetched it first is the only one who learns the response URI. A POST carries the wallet’s wallet_metadata and wallet_nonce (OpenID4VP 1.0, section 5.10); the nonce is repeated in the object, the wallet metadata’s issuer becomes its aud.

POST BASE_URLresponse/TOKEN

The wallet’s response, direct_post or direct_post.jwt, at most MAX_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#

  1. 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’s CLASS), the expiry, its return URL and its notification URL. kych-oid4vp stores the session with a fresh nonce, state and – for direct_post.jwt – an ephemeral P-256 key to which the response is to be encrypted, and answers with the authorization request URI: AUTHORIZATION_REQUEST_URI with client_id, request_uri and request_uri_method.

  2. The wallet fetches the request object: signed with the access certificate’s key (ES256), its chain as x5c, the client identifier x509_hash: (the certificate’s hash; the HAIP profile) or x509_san_dns: (a DNS name of the certificate, which BASE_URL’s host must be), the DCQL query, client_metadata with the encryption key and the offered A128GCM/A256GCM, exp the session’s expiry, and, if KyCH sent one, the registration certificate as verifier_info.

  3. 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.jwt response must be a JWE that decrypts with the session’s key, under an offered content encryption and its kid; a cleartext response to it, or an encrypted one to direct_post, fails (a wallet’s error response may come in the clear either way); a response over MAX_RESPONSE_BYTES is 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 x5c leaf, typ, iss named by that certificate, exp/nbf, every disclosure’s digest (a changed or smuggled one fails), and the key-binding JWT – signed by the credential’s cnf key, nonce the session’s, aud the client identifier, iat no older than KB_JWT_MAX_AGE, sd_hash over the presentation. An mdoc: issuerAuth by its x5chain leaf, the MSO’s doctype, digest algorithm and validity, every data element’s digest, and deviceSignature by 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 Accept application/statuslist+jwt for an SD-JWT VC and application/statuslist+cwt for an mdoc, its signature and sub checked, 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 (vct values or doctype, every requested claim or one claim_sets option) and together meet the credential sets;

    • replay: the digest of every presentation’s holder binding is remembered, and one accepted before fails the session.

  4. The session ends verified, with the disclosed claims and the evidence in KyCH’s own shape, or failed. 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.conf

The configuration (root:kych-oid4vp 0640).

/etc/kych-oid4vp/secrets/api.secret.conf

API_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.pem

The access certificate’s private key (PKCS#8) and its chain, leaf first.

/usr/share/kych-oid4vp/nginx/kych-oid4vp.conf

An 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>.