1 //******************************************************************
3 // Copyright 2014 Intel Corporation All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef OC_SECURITY_CONFIG_H
22 #define OC_SECURITY_CONFIG_H
26 #define DTLS_PSK_ID_LEN 16
27 #define DTLS_PSK_PSK_LEN 16
29 #define DtlsPskCredsBlobVer_1 1 /**< Credentials stored in plaintext */
30 #define DtlsPskCredsBlobVer_CurrentVersion DtlsPskCredsBlobVer_1
33 * Credentials for a device. Includes identity and the associated PSK.
37 unsigned char id[DTLS_PSK_ID_LEN];
38 unsigned char psk[DTLS_PSK_PSK_LEN];
42 * Binary blob containing device identity and the credentials for all devices
43 * trusted by this device.
47 uint16_t blobVer; /**< version of the blob */
48 uint16_t reserved; /**< reserved for future use */
49 unsigned char identity[DTLS_PSK_ID_LEN]; /**< identity of self */
50 uint32_t num; /**< number of credentials in this blob */
51 OCDtlsPskCreds *creds; /**< list of credentials. Size of this
52 array is determined by 'num' variable. */
56 #endif //OC_SECURITY_CONFIG_H