Skip to content

Commit 2839d51

Browse files
committed
Specify an HDK key alias format
1 parent 5f738a5 commit 2839d51

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

draft-dijkhuis-cfrg-hdkeys.md

+58
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ normative:
3939
author:
4040
- organization: ISO/IEC
4141
date: 2019-09
42+
RFC4648:
43+
RFC5234:
4244
RFC8017:
4345
RFC9180:
4446
RFC9380:
@@ -403,6 +405,62 @@ After step 7, the unit can use the value of `salt'` to derive next-level HDKeys.
403405

404406
Step 4 MAY be postponed to be combined with step 6. Steps 5 to 8 MAY be combined in concurrent execution for multiple indices.
405407

408+
## The HDK key alias format
409+
410+
An HDK can be represented canonically using the following string format, in augmented Backus-Naur form (ABNF) [RFC5234] and applying non-padded base64url encoding [RFC4648] for key handles:
411+
412+
~~~
413+
hdk-key-alias = origin-alias "/" path
414+
415+
; The origin-alias is an opaque identifier for a device
416+
; key pair, the associated HDK instantiation, and the seed.
417+
origin-alias = 1*255no-slash
418+
419+
; The hdk-path identifies the indices and key handles to
420+
; apply from left to right.
421+
hdk-path = hdk-index *("/" hdk-sub-path)
422+
423+
hdk-sub-path = *(hdk-edge "/") hdk-index
424+
hdk-edge = ("#" hdk-key-handle) / hdk-index
425+
426+
; The index is to be parsed to an integer between 0 and
427+
; 2^32-1 (inclusive) and used as input to CreateContext.
428+
hdk-index = non-zero-digit 0*9DIGIT
429+
430+
; The key handle is to be decoded from
431+
hdk-key-handle = 1*base64url-char
432+
433+
no-slash = %x21-%x2E / %x30-%x7E ; ASCII printable, no "/"
434+
non-zero-digit = %31-39
435+
base64url-char = ALPHA / DIGIT / "-" / "_"
436+
~~~
437+
438+
A unit MAY use the HDK key alias format to represent keys internally.
439+
440+
A unit MUST NOT directly include the device private key in the `origin-alias`.
441+
442+
A unit MUST NOT directly include the seed in the `origin-alias`.
443+
444+
When taking input in the HDK key alias format:
445+
446+
- a unit MAY pose further limitations on the value of `origin-alias`;
447+
- a unit MUST limit either the amount of `hdk-edge` instances or the total length of the `hdk-key-alias`;
448+
- a unit MUST verify that the byte strings represented by `hdk-key-handle` has the size of ciphertext in `KEM`.
449+
450+
Example key handles:
451+
452+
~~~
453+
my_pid_key/0
454+
455+
my_pid_key/12345
456+
457+
my_pid_key/0/iS2ipkvGCDI0-Lps25Ex2KdjTfGRmIBjGEHkjBCPoQg/3
458+
459+
; newline for printing purposes not in the actual hdk-path
460+
second_key/123/45/itnCVhZ-DYZDaUqofDNhHEbNc9XOrdnLL9B-9dVZ
461+
tTg/6789/3JVRsML8NvUnCx1CvzpZrHSn4TkSUpGgn8r-X_RiQ1Y/3
462+
~~~
463+
406464
# Generic HDK instantiations
407465

408466
## Using digital signatures

0 commit comments

Comments
 (0)