@@ -102,44 +102,46 @@ docker run -ti --rm -p 6502:6502 \
102102
103103This system uses OPRF for pseudonym generation. To test this, there are some available endpoints:
104104
105- - '/test/oprf/gen_rsa_key' - Generate a new RSA keypair for OPRF (small 1024 bit for testing)
106105- '/test/oprf/oprf/client' - Emulates a client that generates OPRF information for a given input
107106- '/test/oprf/oprf/receiver' - Emulates the receiver of the pseudonym and returns diagnostic information
108107
109108To use this system:
110109
111- 1 . First, generate a new keypair that will be used for a test organization with ` /test/oprf/gen_rsa_key ` .
112- ``` shell
113- POST /test/oprf/gen_rsa_key
114-
115- 200 OK
116- {
117- " private_key_pem" : " -----BEGIN PRIVATE KEY-----\nMIICdwIBA....neDKJ0DsvA5vfpt0=\n-----END PRIVATE KEY-----\n" ,
118- " public_key_pem" : " -----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqG....uDQIDAQAB\n-----END PUBLIC KEY-----\n" ,
119- " public_key_kid" : " ajGAx_LKNrJ8vqdahWlSJvOznBi6lnFfSOw72Z4R4uU"
120- }
121- ```
110+ 1 . You will need a generated UZI Server certificate (https://www.uziregister.nl/servercertificaat ) or create a
111+ self-signed certificate for testing purposes.
112+
113+ Since the system uses mTLS, you can either setup a mTLS setup (caddy, apache, etc), or enable the override in the
114+ app.conf file:
115+
116+ ```
117+ [app]
118+ mtls_override_cert=./secrets/self-signed-uzi-server-cert.crt
122119
123- 2 . Create a new organization into the key resolver with a POST to ` /keys ` . Add your organization name like
124- ` ura:12345678 ` , and you can use scope ` test ` for testing. Add the ** PUBLIC key ** to the ` public_key ` field .
120+ 2. Insert a new organization via a POST to `/orgs `. The organization ura should be the URA of the uzi certificate you
121+ will be testing with .
125122
126- ``` shell
127- POST /keys
128- {
129- " organization" : " ura:12345678" ,
130- " scope" : " test" ,
131- " public_key" : " -----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqG....uDQIDAQAB\n-----END PUBLIC KEY\n" ,
132- }
123+ Note: there is no mTLS check here. You can add multiple organizations with different URA values for testing.
124+
125+ 3. Next, you will need to register your public key to the key services. You can do this by calling `/register/certificate` with a JSON body like:
133126
134- 201 Created
135- ```
127+ ```shell
128+ POST /register/certificate
129+ {
130+ "scope": [
131+ "nvi",
132+ ]
133+ }
134+ ```
135+
136+ This will take the public key from the uzi server certificate using in this mTLS connection, and register it for the given scope.
136137
137- 3. Emulate a client wanting to send a pseudonym over to a receiver by calling ` /test/oprf/client` with a JSON body like:
138+
139+ 4 . Emulate a client wanting to send a pseudonym over to a receiver by calling ` /test/oprf/client ` with a JSON body like:
138140
139141 ``` shell
140142 POST /test/oprf/client
141143 {
142- " personalId" : " testinput-like-a- bsn-number-or-other-id "
144+ " personalId" : " nl: bsn:950000012 "
143145 }
144146
145147 200 OK
@@ -149,7 +151,7 @@ To use this system:
149151 }
150152 ```
151153
152- This returns the ` blinded_input` that must be sent to the receiver, and the ` blind_factor` that must be send to the
154+ This returns the ` blinded_input ` that must be sent to the receiver, and the ` blind_factor ` that must be sent to the
153155 receiver after the server has evaluated the blinded input.
154156
1551574 . Now we can call the "real" OPRF function ` /oprf/eval ` with the blinded input, the organization name and scope:
@@ -172,13 +174,13 @@ To use this system:
172174 is encrypted with the public key of the organization. At this point, the client is
173175 not able to decrypt this information. It can only forward this to the receiver.
174176
175- 5. Now emulate the receiver by calling ` /test/oprf/receiver` with a JSON body like:
177+ 5. Now emulate the receiving party by calling ` /test/oprf/receiver` with a JSON body like:
176178 ` ` ` shell
177179 POST /test/oprf/receiver
178180 {
179181 " blind_factor" : " eNf80WNHbImaUNU-kokBr7ocELBjMtHcy0re_RKBPQ8=" ,
180182 " jwe" : " eyJraWQiOiA...SzZbJUqbbSUIjqiw" ,
181- " priv_key_pem" : " -----BEGIN RSA PRIVATE KEY-----\nMIICXAIB ...oCfe0=\n -----END RSA PRIVATE KEY-----\n "
183+ " priv_key_pem" : " -----BEGIN RSA PRIVATE KEY----- MIICXAIB ...oCfe0= -----END RSA PRIVATE KEY-----"
182184 }
183185 ` ` `
184186
@@ -190,7 +192,7 @@ To use this system:
190192 ` ` ` json
191193 {
192194 " jwe_data" : " eyJraWQiOiAi...zZbJUqbbSUIjqiw" ,
193- " priv_key_pem" : " -----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgH6gmpXpdhtiE ...UpWRvoCfe0=\n -----END RSA PRIVATE KEY-----\n " ,
195+ " priv_key_pem" : " -----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgH6gmpXpdhtiE ...UpWRvoCfe0= -----END RSA PRIVATE KEY-----" ,
194196 " priv_key_kid" : " rNv1O_mXgxF6QEMfaQGvjev7RbT1FG3sJXxxsu_KHbM" ,
195197 " blind_factor" : " eNf80WNHbImaUNU-kokBr7ocELBjMtHcy0re_RKBPQ8=" ,
196198 " jwe" : {
@@ -216,3 +218,21 @@ To use this system:
216218
217219 The ` final_pseudonym` is the actual pseudonym that can be stored by the receiver. Note that this pseudonym is deterministic
218220 for the same input, organization and scope. However, it is not possible to reverse this into a BSN.
221+
222+
223+
224+ # max-key-usage
225+
226+ The max-key-usage is a property that defines what kind of pseudonyms an organization can create and reverse.
227+
228+ There are 3 levels of max_key_usage:
229+
230+ - BSN - can create reversible and irreversible pseudonyms, and can reverse reversible pseudonyms back to BSN
231+ - RP (Reversible Pseudonym) - can create reversible and irreversible pseudonyms, but cannot reverse any pseudonyms
232+ - IRP (Irreversible Pseudonym) - can only create irreversible pseudonyms, and cannot reverse any pseudonyms
233+
234+ The " RP" level is mainly intended for organizations that need to create reversible pseudonyms for other organizations,
235+ but is not allowed to reverse them back to BSN itself.
236+
237+ The " IRP" level is intended for organizations that only need to create irreversible pseudonyms, and do not have access to
238+ BSN information at all.
0 commit comments