Skip to main content

Cookbook: Accept Only Trusted Issuers

In chapter 3, membership-check accepts the membership credential only from issuers on the trust list membership-issuers. You now test it with a credential from an issuer that is not on the list, and then switch to a trust list published by someone else.

What you will build​

A second signing key acts as an untrusted issuer of the same credential type. membership-check rejects its credentials, either in the wallet or during verification.

Before you start​

  • Starts from: Issue and verify: tenant membership-demo with the key chain Membership credential signing, the credential configuration membership, the trust list membership-issuers, the presentation configuration membership-check that references it, and the wallet with the membership credential.
  • curl, jq and the secret of membership-demo-admin for the checks. Get a token:
export EUDIPLO=http://localhost:3000
read -rs ADMIN_SECRET
ADMIN_TOKEN=$(curl -s -X POST "$EUDIPLO/api/oauth2/token" \
-d grant_type=client_credentials -d client_id=membership-demo-admin \
--data-urlencode client_secret="$ADMIN_SECRET" | jq -r .access_token)

Step 1: Issue a credential from an untrusted issuer​

Create a second issuer key in the same tenant and a credential type of the same VCT that uses it:

  1. Under Keys, create Credential Signing (Attestation) → Key Chain with Root CA with description Untrusted signing.
  2. Under Credential Configs, create membership-untrusted exactly like membership in chapter 2, step 4, with two differences: Display Name Untrusted membership, and the signing key chain Untrusted signing.
  3. Send a pre-authorized offer for membership-untrusted with the default values, and accept it in the wallet.

Checkpoint: the wallet holds two credentials of type urn:example:membership:1: Membership and Untrusted membership.

Step 2: Test the untrusted issuer​

Generate a new request for membership-check and scan it. There are two correct outcomes:

  • The wallet offers only Membership. It filtered by the aki values. Present it; the session is completed.
  • The wallet offers both. Choose Untrusted membership. EUDIPLO rejects it.

To see the server-side rejection with a wallet that filters, add VP_REMOVE_TA=true to .eudiplo.env and run eudiplo up --instance cookbook. EUDIPLO then leaves trusted_authorities out of the wallet request but still enforces the list. Remove the setting afterwards.

Checkpoint: the session of the untrusted credential is failed:

curl -s "$EUDIPLO/api/session/<presentation session ID>" -H "Authorization: Bearer $ADMIN_TOKEN" \
| jq '{status, failureCode, errorReason}'

failureCode is trust_chain_not_trusted ("The credential issuer is not in the trusted list.") or no_trust_chain_to_root.

Variant: use a trust list published by someone else​

To accept the issuers of an external List of Trusted Entities (LoTE), edit membership-check and replace the managed trust list under Issuer trust with Add external trust list. Enter the External trust-list URL and, under Trust-list verification material, the Verification certificate (base64 DER) of the list's signer. In the query this becomes:

{ "type": "etsi_tl", "values": [{ "url": "https://trust.example.org/lists/members", "verifierX509Der": "MIIB..." }] }

Without verification material, EUDIPLO cannot check the list's signature, and verification fails with trust_list_unavailable. EUDIPLO caches fetched lists for 5 minutes; DELETE /api/cache/trust-list clears your tenant's cached lists after the publisher changes a list. To try the variant without a second organization, enter the Trust List URL of membership-issuers from chapter 3. For the certificate, open Membership trust list signing under Keys, choose Copy PEM under Active Certificate, and paste it without the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines.

Checkpoint: presenting Membership completes the session as in chapter 3, and Untrusted membership is rejected as in step 2.

Troubleshooting​

SymptomCauseFix
The trusted credential is rejected tooThe entity lists a different issuer key chainEdit the list and select Membership credential signing as Issuer Key Chain.
The wallet offers no credential at allThe wallet cannot match the aki valuesTest with VP_REMOVE_TA=true; report the wallet's behavior to its vendor.
trust_list_unavailableThe list URL is unreachable, the list has no valid NextUpdate or one that has passed, it is numbered lower than a list accepted before (Older versions of a list), or the verification material is missing or wrongOpen the URL; for external lists, check verifierX509Der (the signer's certificate without the PEM header and footer lines) or verifierKey.

General problems are covered in Troubleshooting.

Next steps​

  • Trust lists: entity types, wallet provider lists and renewal.
  • DCQL: trusted_authorities together with other query options.
  • Keys and certificates: import issuer certificates from your PKI.