Skip to main content

Get an X509Credential from a UZI certificate

ThisSpec document describes how to issue the X509Credential for a UZI server certificate, used to authenticate in several applications on Nuts/v2 use cases.

cases,

Introduction

like

Several360-graden-clientbeeld, applicatopns-on-nuts specify thatidentify care organizations are authenticated using a Verifiable Credential containingby their URA number. As theThe CIBG doesn’doesn't issue theseVerifiable credentialsCredentials with the URA yet, it’sso derivedyou create one yourself from the X.509care organization's UZI Serverserver Certificate in the form ofcertificate: an X509Credential.

The credentialnode willuses thenthe beX509Credential used for 2 purposes:to:

  • Registeringregister the care organization on the Discovery Service, so other participantsparties can resolvefind keyit;
material and API endpoints ofprove the care organization(s).organization's Authenticating to other participantsidentity when enrollingit patientsrequests andan exchangingaccess data.token from another party.

The X509Credential will be issued to a DID (Decentralized Identifier) that resides in the Nuts node into which the credential will be loaded. Afterward, the Nuts node can authenticate as the care organization by presenting the credential.

The X509Credential will containcontains the UZI certificate itself,certificate, and the extracted (from the certificate) URA, name,name and localitycity oftaken thefrom careit. organization. The X509CredentialIt is signed with the certificate's private keykey. backingIt the certificate. Note that the X509Credentialdoes will not contain the private key itself.key.

ForDo non-productionthis environmentsonce (test,per acceptance),care seeorganization, per environment. Repeat it before the lastUZI sectioncertificate of this document.expires.

Requirements

Before you start

  • The care organization has a subject, and you have its did:web DID (Decentralizedsee Identifier)"Create toa which the X509Credential will be issued. Supplied by the Nuts node hoster (usually the vendor)subject").
  • CIBGThe care organization's UZI Serverserver Certificate:certificate from the CIBG:
    • Fullthe full certificate chain (root CA certificate up untilto the leafcertificate certificate)itself) as a PEM filefile;
    • Decryptedthe unencrypted private key of the leaf certificate as a PEM filefile.
  • A system with Docker installedDocker, to run the nutsfoundation/go-didx509-toolkit (https://hub.docker.com/r/nutsfoundation/go-didx509-toolkit)
    • The source code of the Docker image can be found here: https://github.com/nuts-foundation/go-didx509-toolkit(source).
    For non-production environments: a checkout of https://github.com/nuts-foundation/go-didx509-toolkit that can run a Bash script, with openssl installed.

    Procedure

      Run

      Create the followingcredential

      command from a directory that contains a directory called certs with

      Put the certificate chain (certificate.pem) and private key (privatekey.pem) PEMin files.a Replacedirectory called certs. From the directory that contains certs, run (replace <did> with the propercare DID.

      organization's DID):
      docker run --rm -v "$(pwd)/certs:/certs" \
        nutsfoundation/go-didx509-toolkit:1.1.2.0 \
        vc /certs/certificate.pem /certs/privatekey.pem \
        "CN=UZI-register Private Server CA G1,O=CIBG,C=NL,2.5.4.97=#130e4e54524e4c2d3530303030353335" \
        <did>
      

      Note: checkCheck https://hub.docker.com/r/nutsfoundation/go-didx509-toolkit/tags for the latest version.

      ThisThe yieldsoutput anis the X509Credential inas a JWT format(a whichlong canstring thenstarting bewith loadedeyJ). Load it into the care organization’organization's credential wallet in itsthe Nutsnext Node.step, E.g.:"Load the credential into the wallet".

      eyJhbGciOiJQUzI1NiIsImtpZCI6ImRpZDp4NTA5OjA6c2hhMjU2OnN6cU1hVHBuRDZHTjBhUnJUOThlVjRiaEFvT2d5SXRFWlZ5c2tZeUxfUWM6OnNhbjpvdGhlck5hbWU6Mi4xNi41MjguMS4xMDA3Ljk5LjIxMTAtMS0wLVMtMjE1MTQtMDAuMDAwLTA6OnN1YmplY3Q6TDpOaWV1d2VnZWluOk86QW50b25pdXMlMjBaaWVrZW5odWlzIzAiLCJ0eXAiOiJKV1QiLCJ4NWMiOlsiTUlJRDBqQ0NBcnFnQXdJQkFnSVVGVFBPK3BVazMyUVdzWXlMWWRsTFRtbFJXVmt3RFFZSktvWklodmNOQVFFTEJRQXdHekVaTUJjR0ExVUVBd3dRUm1GclpTQlZXa2tnVW05dmRDQkRRVEFlRncweU5UQXhNamd4TmpFeU1EUmFGdzB5TmpBeE1qZ3hOakV5TURSYU1JR0RNVUl3UUFZRFZRUURERGxoYm5SdmJtbDFjM3BwWld0bGJtaDFhWE11WkdWMlpXeHZjRzFsYm5RdWFXNTBaV2R5WVhScGIyNHVlbTl5WjJKcGFtcHZkUzVqYjIweEhEQWFCZ05WQkFvTUUwRnVkRzl1YVhWeklGcHB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zROh1iavZ6zjnd1GhDH3tq1RMXGBmNQBwlon2Bk2bfB-3oeGkEzhDvt5Mo8sBlDI-E-4htqZx17UR6uC5J_bVf4fklULxZzeUQ7-y7qeEz5bcyYOin3hKlecWDjRa4yQvCxAjz2ICQ
      

      Additional procedure for non-

      Non-production environments

      For non-production (e.g.,environments, test or acceptance) environments,the CIBG issues test-gradetest certificates that don’t match the actual care organization’swhose name, URA and locality.city Indon't thosematch cases,the real care organization. Where the use case allows it, you can instead create a self-signed test CA is used to self-issue a “fake”fake UZI server certificate.certificate Thewith self-signeda test CACA:

      can
      be found

      Check in the test_ca directory inout https://github.com/nuts-foundation/go-didx509-toolkit. UseYou theneed followingBash commandand (inopenssl.

      In the test_ca directory)directory, to issue a certificate:run:

      ./issue-cert.sh <domain (CN)> <name (O)> <localitycity (L)> <uzi> <ura> <agb>
      

      Note that the values forThe domain, UZI and AGB arevalues arbitrarycan andbe notanything; useduse incases thedon't Shareduse Care Planning ecosystem.them.

      It outputs the generatedThe certificate chain PEM file and private key PEMare filewritten into the out directory. UseCopy thesethem into your certs directory.

      Create the procedurecredential documentedas above.

      above,

      Also, make sure to replace the DN of the certificate CA in the issuance command (CN=UZI-register Private Server CA G1… )but with "CN=Fake UZI Root CA" .

      The command should then looks as follows:the CA:

      docker run --rm -v "$(pwd)/certs:/certs" \
        nutsfoundation/go-didx509-toolkit:1.1.2.0 \
        vc /certs/somedomain-chain.pem /certs/somedomain.key \
        "CN=Fake UZI Root CA" \
        <did>
      

      Which CAs an environment accepts is set in the use case's Discovery Service definition. For 360-graden-clientbeeld:

      Environment Accepted certificates Development, test Fake UZI certificates and CIBG test certificates Acceptance CIBG-issued certificates (test and real), not fake ones Production Real CIBG-issued certificates only