1c87c5fbaSopenharmony_ci// -*- mode:doc; -*-
2c87c5fbaSopenharmony_ci// vim: set syntax=asciidoc tw=0
3c87c5fbaSopenharmony_ci
4c87c5fbaSopenharmony_cicoap-oscore-conf(5)
5c87c5fbaSopenharmony_ci===================
6c87c5fbaSopenharmony_ci:doctype: manpage
7c87c5fbaSopenharmony_ci:man source:   coap-oscore-conf
8c87c5fbaSopenharmony_ci:man version:  @PACKAGE_VERSION@
9c87c5fbaSopenharmony_ci:man manual:   Coap OSCORE configuration file format
10c87c5fbaSopenharmony_ci
11c87c5fbaSopenharmony_ciNAME
12c87c5fbaSopenharmony_ci-----
13c87c5fbaSopenharmony_cicoap-oscore-conf
14c87c5fbaSopenharmony_ci- CoAP OSCORE configuration file format
15c87c5fbaSopenharmony_ci
16c87c5fbaSopenharmony_ciDESCRIPTION
17c87c5fbaSopenharmony_ci-----------
18c87c5fbaSopenharmony_ciThe OSCORE configuration file is read in when using the _*-E* oscore_conf_file_
19c87c5fbaSopenharmony_cioption for the *coap-client*(5) or *coap-server*(5) executables. This then
20c87c5fbaSopenharmony_ciallows a client or server to use OSCORE to protect the CoAP information
21c87c5fbaSopenharmony_cibetween endpoints (https://rfc-editor.org/rfc/rfc8613[RFC8613]).
22c87c5fbaSopenharmony_ci
23c87c5fbaSopenharmony_ciIt is also read in and parsed by *coap_new_oscore_conf*(3).
24c87c5fbaSopenharmony_ci
25c87c5fbaSopenharmony_ciThis configuration file can be a configuration held in memory, the formatting
26c87c5fbaSopenharmony_ciof the memory region is same as that for a file as if the file was mapped
27c87c5fbaSopenharmony_ciinto memory. The *coap_new_oscore_conf*(3) function uses the memory
28c87c5fbaSopenharmony_civersion of the file.
29c87c5fbaSopenharmony_ci
30c87c5fbaSopenharmony_ciThe configuration file comprises of a set of keywords, the value of the
31c87c5fbaSopenharmony_cikeyword encoding type and the keyword value, one per line, comma separated.
32c87c5fbaSopenharmony_ci
33c87c5fbaSopenharmony_cikeyword,encoding,value
34c87c5fbaSopenharmony_ci
35c87c5fbaSopenharmony_ciThe keywords are case sensitive.  If a line starts with a *#*, then it is
36c87c5fbaSopenharmony_citreated as a comment line and so is ignored. Empty lines are also valid
37c87c5fbaSopenharmony_ciand ignored.
38c87c5fbaSopenharmony_ci
39c87c5fbaSopenharmony_ciThe possible encodings are:
40c87c5fbaSopenharmony_ci
41c87c5fbaSopenharmony_ci*ascii* ::
42c87c5fbaSopenharmony_ci    The value is encoded as a binary representation of the ascii string. This
43c87c5fbaSopenharmony_ci    string can optionally be enclosed in _"_.
44c87c5fbaSopenharmony_ci
45c87c5fbaSopenharmony_ci*bool* ::
46c87c5fbaSopenharmony_ci    The textual string is either true or false and is subsequently encoded as
47c87c5fbaSopenharmony_ci    an integer number.
48c87c5fbaSopenharmony_ci
49c87c5fbaSopenharmony_ci*hex* ::
50c87c5fbaSopenharmony_ci    The value is encoded as a binary representation of the hex string. This
51c87c5fbaSopenharmony_ci    string can optionally be enclosed in _"_.
52c87c5fbaSopenharmony_ci
53c87c5fbaSopenharmony_ci*integer* ::
54c87c5fbaSopenharmony_ci    The value is encoded as an integer number.
55c87c5fbaSopenharmony_ci
56c87c5fbaSopenharmony_ci*text* ::
57c87c5fbaSopenharmony_ci    The string value is mapped and then encoded as an integer number. This
58c87c5fbaSopenharmony_ci    string can optionally be enclosed in _"_. A subset of the Names from
59c87c5fbaSopenharmony_ci    https://www.iana.org/assignments/cose/cose.xhtml#algorithms or
60c87c5fbaSopenharmony_ci    https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves are
61c87c5fbaSopenharmony_ci    supported.
62c87c5fbaSopenharmony_ci
63c87c5fbaSopenharmony_ciThe valid keywords are:
64c87c5fbaSopenharmony_ci
65c87c5fbaSopenharmony_ci*master_secret* ::
66c87c5fbaSopenharmony_ci    (*hex* or *ascii*) (*Required*) (No default) +
67c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
68c87c5fbaSopenharmony_ci    Security Context Definition]".
69c87c5fbaSopenharmony_ci    Master Secret. Variable length. Must be the same for both client and
70c87c5fbaSopenharmony_ci    server.
71c87c5fbaSopenharmony_ci
72c87c5fbaSopenharmony_ci*master_salt* ::
73c87c5fbaSopenharmony_ci    (*hex* or *ascii*) (*Optional*) (No default) +
74c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
75c87c5fbaSopenharmony_ci    Security Context Definition]".
76c87c5fbaSopenharmony_ci    Master Salt. Variable length. Must be the same for both client and
77c87c5fbaSopenharmony_ci    server.
78c87c5fbaSopenharmony_ci
79c87c5fbaSopenharmony_ci*id_context* ::
80c87c5fbaSopenharmony_ci    (*hex* or *ascii*) (*Optional*) (No default) +
81c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
82c87c5fbaSopenharmony_ci    Security Context Definition]".
83c87c5fbaSopenharmony_ci    ID Context. Variable length. Must be the same for both client and
84c87c5fbaSopenharmony_ci    server.
85c87c5fbaSopenharmony_ci
86c87c5fbaSopenharmony_ci*sender_id* ::
87c87c5fbaSopenharmony_ci    (*hex* or *ascii*) (*Required*) (No default) +
88c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
89c87c5fbaSopenharmony_ci    Security Context Definition]".
90c87c5fbaSopenharmony_ci    Sender ID.  This is the local application ID.
91c87c5fbaSopenharmony_ci    Maximum length is determined by the AEAD Algorithm (typically 7 bytes).
92c87c5fbaSopenharmony_ci
93c87c5fbaSopenharmony_ci*recipient_id* ::
94c87c5fbaSopenharmony_ci    (*hex* or *ascii*) (*Required* for client, else *Optional*) (No default) +
95c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
96c87c5fbaSopenharmony_ci    Security Context Definition]".
97c87c5fbaSopenharmony_ci    Recipient ID. This is the remote peer application ID.
98c87c5fbaSopenharmony_ci    Maximum length is determined by the AEAD Algorithm (typically 7 bytes).
99c87c5fbaSopenharmony_ci    For servers, there can be zero or more (unique) recipient_ids.
100c87c5fbaSopenharmony_ci    Additional recipient_ids can be added programmatically to the OSCORE
101c87c5fbaSopenharmony_ci    configuration - see *coap_new_oscore_recipient*(3).
102c87c5fbaSopenharmony_ci    For clients, there should only be one recipient_id (only the first is used).
103c87c5fbaSopenharmony_ci
104c87c5fbaSopenharmony_ci*replay_window* ::
105c87c5fbaSopenharmony_ci    (*integer*) (*Optional*) (Default is 32) +
106c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
107c87c5fbaSopenharmony_ci    Security Context Definition]".
108c87c5fbaSopenharmony_ci    Recipient Replay Window (Server Only). Supported values are 1 - 63.
109c87c5fbaSopenharmony_ci
110c87c5fbaSopenharmony_ci*aead_alg* ::
111c87c5fbaSopenharmony_ci    (*integer* or *text*) (*Optional*) (Default is 10 or "AES-CCM-16-64-128") +
112c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
113c87c5fbaSopenharmony_ci    Security Context Definition]".
114c87c5fbaSopenharmony_ci    AEAD Algorithm. Only the mandatory and a small subset of the algorithms
115c87c5fbaSopenharmony_ci    are supported depending on the TLS library.
116c87c5fbaSopenharmony_ci
117c87c5fbaSopenharmony_ci*hkdf_alg* ::
118c87c5fbaSopenharmony_ci    (*integer* or *text*) (*Optional*) (Default is -10 or "direct+HKDF-SHA-256") +
119c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#section-3.1[RFC8613 Section 3.1.
120c87c5fbaSopenharmony_ci    Security Context Definition]".
121c87c5fbaSopenharmony_ci    HDKF Algorithm. Only the mandatory and a small subset of the algorithms
122c87c5fbaSopenharmony_ci    are supported depending on the TLS library.
123c87c5fbaSopenharmony_ci
124c87c5fbaSopenharmony_ci*rfc8613_b_1_2* ::
125c87c5fbaSopenharmony_ci    (*bool*) (*Optional*) (Default is true) +
126c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#appendix-B.1.2[RFC8613 Appendix B.1.2.
127c87c5fbaSopenharmony_ci    Replay Window]".
128c87c5fbaSopenharmony_ci    Enable server rebooting Replay Window.
129c87c5fbaSopenharmony_ci
130c87c5fbaSopenharmony_ci*rfc8613_b_2* ::
131c87c5fbaSopenharmony_ci    (*bool*) (*Optional*) (Default is false) +
132c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#appendix-B.2[RFC8613 Appendix B.2.
133c87c5fbaSopenharmony_ci    Security Context Derived Multiple Times]".
134c87c5fbaSopenharmony_ci    Enable Security Context protocol.
135c87c5fbaSopenharmony_ci
136c87c5fbaSopenharmony_ci*ssn_freq* ::
137c87c5fbaSopenharmony_ci    (*integer*) (*Optional*) (Default is 1) +
138c87c5fbaSopenharmony_ci    "https://rfc-editor.org/rfc/rfc8613#appendix-B.1.1[RFC8613 Appendix B.1.1.
139c87c5fbaSopenharmony_ci    Sender Sequence Number]".
140c87c5fbaSopenharmony_ci    Sender Sequence Number frequency non-volatile storage update rate. Has
141c87c5fbaSopenharmony_ci    to be a positive number.
142c87c5fbaSopenharmony_ci
143c87c5fbaSopenharmony_ciDiagnostic testing options
144c87c5fbaSopenharmony_ci
145c87c5fbaSopenharmony_ci*break_sender_key* ::
146c87c5fbaSopenharmony_ci    (*bool*) (*Optional*) (Default is false) +
147c87c5fbaSopenharmony_ci    Enable random breaking of the derived sender key.
148c87c5fbaSopenharmony_ci
149c87c5fbaSopenharmony_ci*break_recipient_key* ::
150c87c5fbaSopenharmony_ci    (*bool*) (*Optional*) (Default is false) +
151c87c5fbaSopenharmony_ci    Enable random breaking of the derived recipient key.
152c87c5fbaSopenharmony_ci
153c87c5fbaSopenharmony_ciEXAMPLE SERVER OSCORE CONFIGURATION FILE
154c87c5fbaSopenharmony_ci----------------------------------------
155c87c5fbaSopenharmony_ci
156c87c5fbaSopenharmony_ci[source, c]
157c87c5fbaSopenharmony_ci----
158c87c5fbaSopenharmony_ci
159c87c5fbaSopenharmony_ci# Master Secret (same for both client and server)
160c87c5fbaSopenharmony_cimaster_secret,hex,"0102030405060708090a0b0c0d0e0f10"
161c87c5fbaSopenharmony_ci
162c87c5fbaSopenharmony_ci# Master Salt (same for both client and server)
163c87c5fbaSopenharmony_cimaster_salt,hex,"9e7ca92223786340"
164c87c5fbaSopenharmony_ci
165c87c5fbaSopenharmony_ci# Sender ID
166c87c5fbaSopenharmony_cisender_id,ascii,"server"
167c87c5fbaSopenharmony_ci
168c87c5fbaSopenharmony_ci# Recipient ID
169c87c5fbaSopenharmony_cirecipient_id,ascii,"client"
170c87c5fbaSopenharmony_ci
171c87c5fbaSopenharmony_ci# Replay Window (usually 32)
172c87c5fbaSopenharmony_cireplay_window,integer,32
173c87c5fbaSopenharmony_ci
174c87c5fbaSopenharmony_ci# AEAD COSE Cipher Algorithm (usually 10)
175c87c5fbaSopenharmony_ciaead_alg,integer,10
176c87c5fbaSopenharmony_ci
177c87c5fbaSopenharmony_ci# HKDF COSE Algorithm (usually -10)
178c87c5fbaSopenharmony_cihkdf_alg,integer,-10
179c87c5fbaSopenharmony_ci
180c87c5fbaSopenharmony_ci----
181c87c5fbaSopenharmony_ci
182c87c5fbaSopenharmony_ciEXAMPLE CLIENT OSCORE CONFIGURATION FILE
183c87c5fbaSopenharmony_ci----------------------------------------
184c87c5fbaSopenharmony_ci
185c87c5fbaSopenharmony_ci[source, c]
186c87c5fbaSopenharmony_ci----
187c87c5fbaSopenharmony_ci
188c87c5fbaSopenharmony_ci# Master Secret (same for both client and server)
189c87c5fbaSopenharmony_cimaster_secret,hex,"0102030405060708090a0b0c0d0e0f10"
190c87c5fbaSopenharmony_ci
191c87c5fbaSopenharmony_ci# Master Salt (same for both client and server)
192c87c5fbaSopenharmony_cimaster_salt,hex,"9e7ca92223786340"
193c87c5fbaSopenharmony_ci
194c87c5fbaSopenharmony_ci# Sender ID (This is the client who is the Sender)
195c87c5fbaSopenharmony_cisender_id,ascii,"client"
196c87c5fbaSopenharmony_ci
197c87c5fbaSopenharmony_ci# Recipient ID (It is the server that is remote)
198c87c5fbaSopenharmony_cirecipient_id,ascii,"server"
199c87c5fbaSopenharmony_ci
200c87c5fbaSopenharmony_ci# Replay Window (usually 32)
201c87c5fbaSopenharmony_cireplay_window,integer,32
202c87c5fbaSopenharmony_ci
203c87c5fbaSopenharmony_ci# AEAD COSE Cipher Algorithm (usually 10)
204c87c5fbaSopenharmony_ciaead_alg,integer,10
205c87c5fbaSopenharmony_ci
206c87c5fbaSopenharmony_ci# HKDF COSE Algorithm (usually -10)
207c87c5fbaSopenharmony_cihkdf_alg,integer,-10
208c87c5fbaSopenharmony_ci
209c87c5fbaSopenharmony_ci----
210c87c5fbaSopenharmony_ci
211c87c5fbaSopenharmony_ciSEE ALSO
212c87c5fbaSopenharmony_ci--------
213c87c5fbaSopenharmony_ci
214c87c5fbaSopenharmony_ci*coap-client*(5), *coap-server*(5) and *coap_new_oscore_conf*(3)
215c87c5fbaSopenharmony_ci
216c87c5fbaSopenharmony_ciFURTHER INFORMATION
217c87c5fbaSopenharmony_ci-------------------
218c87c5fbaSopenharmony_ciSee
219c87c5fbaSopenharmony_ci
220c87c5fbaSopenharmony_ci"https://tools.ietf.org/html/rfc8613[RFC8613: Object Security for Constrained RESTful Environments (OSCORE)]"
221c87c5fbaSopenharmony_ci
222c87c5fbaSopenharmony_cifor further information.
223c87c5fbaSopenharmony_ci
224c87c5fbaSopenharmony_ciBUGS
225c87c5fbaSopenharmony_ci-----
226c87c5fbaSopenharmony_ciPlease report bugs on the mailing list for libcoap:
227c87c5fbaSopenharmony_cilibcoap-developers@lists.sourceforge.net or raise an issue on GitHub at
228c87c5fbaSopenharmony_cihttps://github.com/obgm/libcoap/issues
229c87c5fbaSopenharmony_ci
230c87c5fbaSopenharmony_ciAUTHORS
231c87c5fbaSopenharmony_ci-------
232c87c5fbaSopenharmony_ciThe libcoap project <libcoap-developers@lists.sourceforge.net>
233