Configuration of Nuts identity
This chapter provides a manual for the initial configuration of the Nuts-node for an organization. It covers:
- Identity creation (once per care organization)
- Registration for a use case (once per care organization, per use case)
- 1. Create organization identity
- 2. Issue X509Credential
- 3. Load X509Credential into organization wallet
- 4. Discovery Service registration
1. Create organization identity
First, a new identity, with associated DID(s), needs to be created for the tuple (organization, environment).
Using API
Perform the following REST API call. Note that subject is optional.
POST <internal Nuts interface>/internal/vdr/v2/subject
Content-Type: application/json
{"subject": "fooorg-acc"}
Using Nuts Admin
- Log in to the organization’s Nuts Admin application. Click on “Identities”.
- Click on the plus sign on the right side.
- Enter the subject: it consists of the tenant, dash, short form of the environment (e.g.
fooorg-acc). This will act as key when interacting with the Nuts node’s APIs for this instance. Note: as deployments are isolated, theoretically, a static key could be used. But having the tenant and environment in the name reduces the possibility of leakage due to mixed-up environments. - Click on “Create Identity”.
2. Issue X509Credential
This document describes how to issue the X509Credential for a UZI server certificate, used to authenticate in several applications on Nuts/ use cases.
Introduction
Several applicatopns-on-nuts specify that care organizations are authenticated using a Verifiable Credential containing their URA number. As the CIBG doesn’t issue these credentials yet, it’s derived from the X.509 UZI Server Certificate in the form of an X509Credential.
The credential will then be used for 2 purposes:
- Registering on the Discovery Service, so other participants can resolve key material and API endpoints of the care organization(s).
- Authenticating to other participants when enrolling patients and exchanging data.
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 contain the UZI certificate itself, and the extracted (from the certificate) URA, name, and locality of the care organization. The X509Credential is signed with the private key backing the certificate. Note that the X509Credential will not contain the private key itself.
For non-production environments (test, acceptance), see the last section of this document.
Requirements
- DID (Decentralized Identifier) to which the X509Credential will be issued. Supplied by the Nuts node hoster (usually the vendor).
- CIBG UZI Server Certificate:
- Full certificate chain (root CA certificate up until the leaf certificate) as PEM file
- Decrypted private key of the leaf certificate as PEM file
- A system with Docker installed to run
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
- For non-production environments: a checkout of https://github.com/nuts-foundation/go-didx509-toolkit that can run a Bash script, with
opensslinstalled.
Procedure
- Run the following command from a directory that contains a directory called
certswith the certificate (certificate.pem) and private key (privatekey.pem) PEM files. Replace<did>with the proper DID.
docker run --rm -v "$(pwd)/certs:/certs" \
nutsfoundation/go-didx509-toolkit:1.1.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: check https://hub.docker.com/r/nutsfoundation/go-didx509-toolkit/tags for the latest version.
This yields an X509Credential in JWT format which can then be loaded into the care organization’s credential wallet in its Nuts Node. E.g.:
eyJhbGciOiJQUzI1NiIsImtpZCI6ImRpZDp4NTA5OjA6c2hhMjU2OnN6cU1hVHBuRDZHTjBhUnJUOThlVjRiaEFvT2d5SXRFWlZ5c2tZeUxfUWM6OnNhbjpvdGhlck5hbWU6Mi4xNi41MjguMS4xMDA3Ljk5LjIxMTAtMS0wLVMtMjE1MTQtMDAuMDAwLTA6OnN1YmplY3Q6TDpOaWV1d2VnZWluOk86QW50b25pdXMlMjBaaWVrZW5odWlzIzAiLCJ0eXAiOiJKV1QiLCJ4NWMiOlsiTUlJRDBqQ0NBcnFnQXdJQkFnSVVGVFBPK3BVazMyUVdzWXlMWWRsTFRtbFJXVmt3RFFZSktvWklodmNOQVFFTEJRQXdHekVaTUJjR0ExVUVBd3dRUm1GclpTQlZXa2tnVW05dmRDQkRRVEFlRncweU5UQXhNamd4TmpFeU1EUmFGdzB5TmpBeE1qZ3hOakV5TURSYU1JR0RNVUl3UUFZRFZRUURERGxoYm5SdmJtbDFjM3BwWld0bGJtaDFhWE11WkdWMlpXeHZjRzFsYm5RdWFXNTBaV2R5WVhScGIyNHVlbTl5WjJKcGFtcHZkUzVqYjIweEhEQWFCZ05WQkFv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-aaNe2xzS4IM_NpchKGpprXqzROh1iavZ6zjnd1GhDH3tq1RMXGBmNQBwlon2Bk2bfB-3oeGkEzhDvt5Mo8sBlDI-E-4htqZx17UR6uC5J_bVf4fklULxZzeUQ7-y7qeEz5bcyYOin3hKlecWDjRa4yQvCxAjz2ICQ
Additional procedure for non-production environments
For non-production (e.g., test or acceptance) environments, CIBG issues test-grade certificates that don’t match the actual care organization’s name, URA and locality. In those cases, a self-signed test CA is used to self-issue a “fake” UZI server certificate. The self-signed test CA can be found in the test_ca directory in https://github.com/nuts-foundation/go-didx509-toolkit. Use the following command (in the test_ca directory) to issue a certificate:
./issue-cert.sh <domain (CN)> <name (O)> <locality (L)> <uzi> <ura> <agb>
Note that the values for domain, UZI and AGB are arbitrary and not used in the Shared Care Planning ecosystem.
It outputs the generated certificate chain PEM file and private key PEM file in the out directory. Use these in the procedure documented above.
Also, make sure to replace the DN of the certificate CA in the issuance command (CN=UZI-register Private Server CA G1… ) with "CN=Fake UZI Root CA" .
The command should then looks as follows:
docker run --rm -v "$(pwd)/certs:/certs" \
nutsfoundation/go-didx509-toolkit:1.1.0 \
vc /certs/somedomain-chain.pem /certs/somedomain.key \
"CN=Fake UZI Root CA" \
<did>
3. Load X509Credential into organization wallet
Using API
To load the credential into the Nuts node via its REST API, perform the following HTTP request:
POST <internal Nuts interface>/internal/vcr/v2/holder/<subjectID>/vc
Content-Type: application/json
"<JWT>"
Replace <subjectID> with the subject, and <JWT> with the credential in JWT format (a JSON string enclosed in double quotes)
Using Nuts Admin
- Log in to the care organization’s Nuts Admin application.
- Click on “Identities”.
- Click on the wallet to load the credential into (there should be only one).
- Click on “Load Credential”.
- Enter/paste the credential in the input field.
- Click on “Load credential”.
4. Discovery Service registration
Before another party can interact with you, they will first need to find your endpoints. The discovery service in the Nuts node helps you. You do this once per organization, per use case.
Using API
POST <internal Nuts interface>/internal/discovery/v1/<servicedefinition-id>/<subject-id>
Content-Type: application/json
{
"registrationParameters": {
"abc": "xyz",
"someparameter": "somevalue"
}
}
Replace <servicedefinition-id> with the servicedefinition-id and replace <subject-id> with the subject-id of the organization.
For each use case a
discovery service definitionis specified that specifies the servicedefinition-id and the registrationParameters.
Using Nuts Admin
to do