forked from Nitrokey/pynitrokey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nethsm-api.yaml
2362 lines (2360 loc) · 73.2 KB
/
nethsm-api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: NetHSM
version: v1
description: All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All <a href="https://tools.ietf.org/html/rfc4648#section-4">base64</a> encoded values are Big Endian.
servers:
- url: https://{host}/api/{version}
variables:
host:
default: nethsmdemo.nitrokey.com
version:
default: v1
paths:
/info:
get:
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/InfoData'
description: Information about the vendor and product.
x-annotation-state:
- Locked
- Operational
- Unprovisioned
x-annotation-role:
- Public
/health/alive:
get:
responses:
'200':
description: Yes, it is alive.
'412':
description: Not locked or unprovisioned (in operational state).
description: Retrieve wether NetHSM is alive (powered up). This corresponds to the state <i>Locked</i> or <i>Unprovisioned</i>.
x-annotation-role:
- Public
x-annotation-state:
- Locked
- Unprovisioned
/health/ready:
get:
responses:
'200':
description: Yes, it is alive and ready.
'412':
description: Not alive and ready (not in operational state).
description: Retrieve wether NetHSM is alive and ready to take traffic. This corresponds to the state <i>Operational</i>.
x-annotation-role:
- Public
x-annotation-state:
- Operational
/health/state:
get:
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/HealthStateData'
description: Retrieve the state of NetHSM.
x-annotation-role:
- Public
x-annotation-state:
- Locked
- Operational
- Unprovisioned
/metrics:
get:
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/MetricsData'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: 'Get metrics. Precondition: NetHSM is <i>Operational</i> and a <b>R-Metrics</b> can be authenticated.'
security:
- basic: []
x-annotation-role:
- Metrics
x-annotation-state:
- Operational
/provision:
post:
responses:
'204':
description: Provisioning was successful, NetHSM is <i>Operational</i> now.
'400':
description: Malformed request data (e.g. malformed time, weak passphrase).
'412':
description: Precondition failed (NetHSM was not <i>Unprovisioned</i>).
description: Initial provisioning, only available in <i>Unprovisioned</i> state.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProvisionRequestData'
required: true
x-annotation-role:
- Public
x-annotation-state:
- Unprovisioned
/unlock:
post:
responses:
'204':
description: Unlock was successful, NetHSM is <i>Operational</i> now.
'400':
description: Bad request (invalid passphrase).
'403':
description: Unlock failed (access denied).
'412':
description: Precondition failed (NetHSM was not <i>Locked</i>).
description: Brings a <i>Locked</i> NetHSM into <i>Operational</i> state.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UnlockRequestData'
required: true
x-annotation-role:
- Public
x-annotation-state:
- Locked
/lock:
post:
responses:
'204':
description: Lock was successful, NetHSM is <i>Locked</i> now.
'401':
description: Authentication required but none provided.
'403':
description: Lock failed (access denied).
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Brings an <i>Operational</i> NetHSM into <i>Locked</i> state.
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
/random:
post:
responses:
'200':
description: Successful request for <i>length</i> random bytes.
content:
application/json:
schema:
$ref: '#/components/schemas/RandomData'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: 'Retrieve cryptographically strong random bytes from NetHSM. Precondition: NetHSM is <i>Operational</i> and a <b>R-Operator</b> can be authenticated.'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RandomRequestData'
required: true
security:
- basic: []
x-annotation-role:
- Operator
x-annotation-state:
- Operational
/keys:
get:
responses:
'200':
description: Successful request for the list of keys.
content:
application/json:
schema:
$ref: '#/components/schemas/KeyList'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Get a list of the identifiers of all keys that are currently stored in NetHSM. Separate requests need to be made to request the individual key data.
parameters:
- name: filter
in: query
description: Only return keys that are can be used by the requester, according to restrictions.
schema:
type: string
security:
- basic: []
x-annotation-role:
- Administrator
- Operator
x-annotation-state:
- Operational
post:
responses:
'201':
description: Successful import of a private key. The response contains a Location header, e.g. "https://nethsm.local/v1/keys/I8mhHYJ1T3uk2lXrwXehVaw9KZzg7K".
'400':
description: Bad request (specified properties are invalid).
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Import a private key into NetHSM and let NetHSM generate a KeyID. The public key will be automatically derived.
requestBody:
content:
application/x-pem-file:
schema:
$ref: '#/components/schemas/PemPrivateKey'
application/json:
schema:
$ref: '#/components/schemas/PrivateKey'
required: true
parameters:
- name: mechanisms
in: query
schema:
type: array
items:
$ref: '#/components/schemas/KeyMechanism'
- name: tags
in: query
schema:
type: array
items:
$ref: '#/components/schemas/ID'
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
/keys/generate:
post:
responses:
'201':
description: Successful creation of new public and private key pair. Set Location header to the new KeyID.
'400':
description: Bad request (specified properties are invalid).
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Generate a pair of public and private key and store it in NetHSM. KeyID is optional as a parameter and will be generated by NetHSM if not present.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/KeyGenerateRequestData'
required: true
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
/keys/{KeyID}:
get:
responses:
'200':
description: |
For response body with content type `application/json`:
* *RSA* keys include `modulus` and `publicExponent` properties.
* P* keys include the common format (0x04 followed by big-endian \
encoded affine coordinates x and y).
* Curve25519 keys are 32 byte, and follow the RFC8032 5.1.2 encoding \
(little endian, x over y).
content:
application/json:
schema:
$ref: '#/components/schemas/PublicKey'
examples:
rsa:
summary: 'RSA'
value:
mechanisms:
- RSA_Signature_PSS_SHA256
type: RSA
restrictions:
tags:
- berlin
key:
modulus: FhJQl11CiY0ifRHXeAqFh4rdSl6
publicExponent: FhJQl11CiY0ifRHXeAqFh4rdSl6
operations: 242
ecdsa:
summary: 'P* Keys'
value:
mechanisms:
- ECDSA_Signature
type: EC_P224
operations: 242
restrictions:
tags:
- berlin
key:
data: BMKlPJ60PNFgsekRwg7n5mTIJkWWy6XLy0ORj14HumKi5qH63JaJzFOWLxYiaB6KH0NOgEKb7rUt
eddsa:
summary: 'Curve25519'
value:
mechanisms:
- EdDSA_Signature
type: Curve25519
operations: 242
restrictions:
tags:
- berlin
key:
data: htnjTKRUz3XnLys5YD2+bKvzXZuu9cvXKwsCnWdzR+4=
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Key for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Retrieve the public key.
security:
- basic: []
x-annotation-role:
- Administrator
- Operator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
put:
responses:
'204':
description: Successful import of a private key.
'400':
description: Bad request (specified properties are invalid).
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'409':
description: Conflict, key already exists for this keyID.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Import a private key into NetHSM and store it under the <i>KeyID</i> path. The public key will be automatically derived.
requestBody:
description: |
For request body with content type `application/json`:
* *RSA* includes `primeP`, `primeQ`, and `publicExponent` properties.
The remaining properties `privateExponent`, `modulus`, ..) are computed.
* *EC_P224*, *EC_P256*, *EC_P384*, *EC_P521* uses the `data` property.
Keys are the raw (big endian) scalar.
* *Curve25519* uses the `data` property.
Keys are the raw (little endian) key.
content:
application/x-pem-file:
schema:
$ref: '#/components/schemas/PemPrivateKey'
application/json:
schema:
$ref: '#/components/schemas/PrivateKey'
examples:
rsa:
summary: RSA
value:
type: RSA
mechanisms:
- RSA_Signature_PSS_SHA256
key:
primeP: AOnWFZ+JrI/xOXJU04uYCZOiPVUWd6CSbVseEYrYQYxc7dVroePshz29tc+VEOUP5T0O8lXMEkjFAwjW6C9QTAsPyl6jwyOQluMRIkdN4/7BAg3HAMuGd7VmkGyYrnZWW54sLWp1JD6XJG33kF+9OSar9ETPoVyBgK5punfiUFEL
primeQ: ANT1kWDdP9hZoFKT49dwdM/S+3ZDnxQa7kZk9p+JKU5RaU9e8pS2GOJljHwkES1FH6CUGeIaUi81tRKe2XZhe/163sEyMcxkaaRbBbTc1v6ZDKILFKKt4eX7LAQfhL/iFlgi6pcyUM8QDrm1QeFgGz11ChM0JuQw1WwkX06lg8iv
publicExponent: AQAB
restrictions:
tags:
- berlin
ecdsa:
summary: P* Keys
value:
type: EC_P224
mechanisms:
- ECDSA_Signature
key:
data: "BgcqhkjOPQIBBgUrgQQAIQM6AATZOhHS/Sed4w=="
restrictions:
tags:
- berlin
eddsa:
summary: Curve25519
value:
type: Curve25519
mechanisms:
- EdDSA_Signature
key:
data: "m0o4HHT5tiwxxJ3hCzK6H9pXt9R854qyJ+q4Lmei/Kg="
restrictions:
tags:
- berlin
required: true
parameters:
- name: mechanisms
in: query
schema:
type: array
items:
$ref: '#/components/schemas/KeyMechanism'
- name: tags
in: query
schema:
type: array
items:
$ref: '#/components/schemas/ID'
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-KeyID: MyNewKey
delete:
responses:
'204':
description: Key was successfully deleted.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Key for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Delete a pair of public and private key.
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
parameters:
- name: KeyID
in: path
required: true
schema:
type: string
/keys/{KeyID}/public.pem:
get:
responses:
'200':
description: |
For response body with content type `application/x-pem-file`:
* Returns the PEM encoded public key, as specified in PKCS #8.
content:
application/x-pem-file:
schema:
$ref: '#/components/schemas/PemPublicKey'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Key for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Retrieve public key in PEM format.
security:
- basic: []
x-annotation-role:
- Administrator
- Operator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
parameters:
- name: KeyID
in: path
required: true
schema:
type: string
/keys/{KeyID}/csr.pem:
post:
responses:
'200':
description: Successful generation of certificate signing request.
content:
application/x-pem-file:
schema:
$ref: '#/components/schemas/PemCSR'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Key for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Retrieve a certificate signing request in PEM format.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DistinguishedName'
required: true
security:
- basic: []
x-annotation-role:
- Administrator
- Operator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
parameters:
- name: KeyID
in: path
required: true
schema:
type: string
/keys/{KeyID}/decrypt:
post:
responses:
'200':
description: |
For response body with content type `application/json`:
* Mode `RAW` returns the raw binary data.
* Mode `PKCS1` returns the raw binary data.
* Mode `OAEP_*` returns the raw binary data.
content:
application/json:
schema:
$ref: '#/components/schemas/DecryptData'
'400':
description: |
Bad Request, e.g. invalid encryption mode.
* Mode `RAW` returns failure if input is bigger than key size.
* Mode `PKCS1` returns failure if input is bigger than key size.
* Mode `OAEP_*` returns failure is input is bigger than key size.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Key for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Decrypt an encrypted message with the secret key.
requestBody:
description: |
For request body with content type `application/json`:
* Mode `RAW` expects raw binary data.
* Mode `PKCS1` expects PKCS1-encoded and padded binary data.
* Mode `OAEP_*` expects EME-OAEP-encoded and padded binary data.
content:
application/json:
schema:
$ref: '#/components/schemas/DecryptRequestData'
required: true
security:
- basic: []
x-annotation-role:
- Operator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
parameters:
- name: KeyID
in: path
required: true
schema:
type: string
/keys/{KeyID}/encrypt:
post:
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/EncryptData'
'400':
description: Bad Request, e.g. invalid mechanism.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Key for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Encrypt a message with the secret key.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EncryptRequestData'
required: true
security:
- basic: []
x-annotation-role:
- Operator
x-annotation-state:
- Operational
x-test-value-KeyID: MyAESKey
parameters:
- name: KeyID
in: path
required: true
schema:
type: string
/keys/{KeyID}/sign:
post:
responses:
'200':
description: |
For response body with content type `application/json`:
* Mode `PKCS1` returns the PKCS1 padded signature
(no signatureAlgorithm OID prepended, since the used hash is not known).
* Mode `PSS_*` returns the EMSA-PSS encoded signature.
* Mode `EdDSA` returns the RFC 8032 (5.1.6) encoding:
r appened with s, in total 64 bytes (each 32 bytes).
* Mode `ECDSA` returns the ASN.1 DER encoded signature
(a SEQUENCE of INTEGER r INTEGER s).
content:
application/json:
schema:
$ref: '#/components/schemas/SignData'
'400':
description: |
Bad Request, e.g. invalid signing mode.
* Mode `PKCS1` returns failure if input is bigger than key size
* Mode `PSS_*` returns failure if the input is not the hash length,
or the private key is smaller than hash length.
* Mode `ECDSA` returns failure if the input exceeds the group size in bits.
The hash algorithm is not part of the encoding.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Key for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Sign a message with the secret key.
requestBody:
description: |
For request body with content type `application/json`:
* Mode `PKCS1` expects the already hashed data.
* Mode `PSS_*` expects the already hashed data.
* Mode `EdDSA` expects the raw message
(ED25519 applies the SHA512 hash internally,
also to derive the nonce).
* Mode `ECDSA` expects the hashed data
(using SHA224 for P224, SHA256 for P256,
SHA384 for P384 and SHA512 for P521).
content:
application/json:
schema:
$ref: '#/components/schemas/SignRequestData'
required: true
security:
- basic: []
x-annotation-role:
- Operator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
parameters:
- name: KeyID
in: path
required: true
schema:
type: string
/keys/{KeyID}/cert:
get:
responses:
'200':
description: ''
content:
application/pgp-keys:
schema:
$ref: '#/components/schemas/PGPPrivateKey'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Certificate for KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Retrieve stored certificate. The content-type header will display the media type of the stored data.
security:
- basic: []
x-annotation-role:
- Administrator
- Operator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
put:
responses:
'201':
description: Successful import of a certificate.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'409':
description: Conflict, certificate already exists for this KeyID.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Store a certificate. Maximum size 1MB. The content-type header provides the media type. Only application/json, application/x-pem-file, application/x-x509-ca-cert, application/octet-stream, text/plain and application/pgp-keys is allowed.
requestBody:
content:
application/x-pem-file:
schema:
$ref: '#/components/schemas/PemCert'
application/x-x509-ca-cert:
schema:
type: string
application/pgp-keys:
schema:
$ref: '#/components/schemas/PGPPrivateKey'
required: true
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
delete:
responses:
'204':
description: Successful deletion of a certificate.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Certificate with this KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Delete the certificate.
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
parameters:
- name: KeyID
in: path
required: true
schema:
type: string
x-test-value: myKey1
/keys/{KeyID}/restrictions/tags/{Tag}:
put:
responses:
'204':
description: Successful addition of the tag.
'304':
description: Tag is already present for this key.
'400':
description: Bad request, tag format is invalid.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: KeyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Add a tag to the authorized set
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
x-test-value-Tag: MyNewTag
delete:
responses:
'204':
description: Successful deletion of the tag.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: Tag or keyID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Delete a tag from the authorized set
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-KeyID: myKey1
x-test-value-Tag: MyTag
parameters:
- name: Tag
in: path
required: true
schema:
type: string
- name: KeyID
in: path
required: true
schema:
type: string
/users:
get:
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/UserList'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Get a list of all user ids that have accounts on NetHSM.
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
post:
responses:
'201':
description: Successful creation of user. The response contains a Location header, e.g. "https://nethsm.local/v1/users/I8mhHYJ1T3uk2lXrwXehVaw9KZzg7K".
'400':
description: Bad request (specified properties are invalid, e.g. weak passphrase).
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Create a new user on NetHSM. The user-ID is generated by NetHSM.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserPostData'
required: true
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
/users/{UserID}:
get:
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/UserData'
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: User for UserID not found.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: 'Get user info: name and role.'
security:
- basic: []
x-annotation-role:
- Administrator
- Operator
x-annotation-state:
- Operational
x-test-value-UserID: operator
put:
responses:
'201':
description: Successful creation of user.
'400':
description: Bad request (specified properties are invalid, e.g. weak passphrase).
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'409':
description: Conflict - user already exists for this user-ID.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Create a user on keyfender.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserPostData'
required: true
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-UserID: newOperator
delete:
responses:
'204':
description: Successful deletion of user.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: User not found for this user-ID.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Delete a user from keyfender.
security:
- basic: []
x-annotation-role:
- Administrator
x-annotation-state:
- Operational
x-test-value-UserID: operator
parameters:
- name: UserID
in: path
required: true
schema:
type: string
/users/{UserID}/passphrase:
post:
responses:
'204':
description: Successful change of passphrase.
'400':
description: Bad request - weak passphrase.
'401':
description: Authentication required but none provided.
'403':
description: Access denied.
'404':
description: User not found for this user-ID.
'412':
description: Precondition failed (NetHSM was not <i>Operational</i>).
description: Update the passphrase.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserPassphrasePostData'
required: true
security:
- basic: []
x-annotation-role:
- Administrator
- Operator
x-annotation-state:
- Operational
x-test-value-UserID: operator
parameters:
- name: UserID
in: path
required: true
schema:
type: string
/users/{UserID}/tags:
get:
responses:
'200':
description: ''
content:
application/json: