Imported Upstream version 1.1.1
[platform/upstream/iotivity.git] / resource / csdk / security / include / securevirtualresourcetypes.h
1 //******************************************************************
2 //
3 // Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 /**
22  * Data type definitions for all oic.sec.* types defined in the
23  * OIC Security Specification.
24  *
25  * Note that throughout, ptrs are used rather than arrays.  There
26  * are two primary reasons for this:
27  * 1) The Spec defines many structures with optional fields, so pre-
28  *    allocating these would be wasteful.
29  * 2) There are in many cases arrays of Strings or arrays of Structs,
30  *    which could not be defined as variable length arrays (e.g. array[])
31  *    without breaking from the structure order and definition in the Spec.
32  *
33  * The primary drawback to this decision is that marshalling functions
34  * will have to be written by hand to marshal these structures (e.g. to/from
35  * Persistent Storage, or across memory boundaries).
36  *
37  * TODO reconcile against latest OIC Security Spec to ensure all fields correct.
38  * (Last checked against v0.95)
39  */
40
41 #ifndef OC_SECURITY_RESOURCE_TYPES_H
42 #define OC_SECURITY_RESOURCE_TYPES_H
43
44 #include <stdint.h> // for uint8_t typedef
45 #include <stdbool.h>
46 #ifdef __WITH_X509__
47 #include "byte_array.h"
48 #endif /* __WITH_X509__ */
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54 /**
55  * Values used to create bit-maskable enums for single-value response with
56  * embedded code.
57  */
58 #define ACCESS_GRANTED_DEF            (1 << 0)
59 #define ACCESS_DENIED_DEF             (1 << 1)
60 #define INSUFFICIENT_PERMISSION_DEF   (1 << 2)
61 #define SUBJECT_NOT_FOUND_DEF         (1 << 3)
62 #define RESOURCE_NOT_FOUND_DEF        (1 << 4)
63 #define POLICY_ENGINE_ERROR_DEF       (1 << 5)
64 #define INVALID_PERIOD_DEF            (1 << 6)
65 #define ACCESS_WAITING_DEF            (1 << 7)
66 #define AMS_SERVICE_DEF               (1 << 8)
67 #define REASON_MASK_DEF               (INSUFFICIENT_PERMISSION_DEF | \
68                                        INVALID_PERIOD_DEF | \
69                                        SUBJECT_NOT_FOUND_DEF | \
70                                        RESOURCE_NOT_FOUND_DEF | \
71                                        POLICY_ENGINE_ERROR_DEF)
72
73
74 /**
75  * Access policy in least significant bits (from Spec):
76  * 1st lsb:  C (Create)
77  * 2nd lsb:  R (Read, Observe, Discover)
78  * 3rd lsb:  U (Write, Update)
79  * 4th lsb:  D (Delete)
80  * 5th lsb:  N (Notify)
81  */
82 #define PERMISSION_CREATE       (1 << 0)
83 #define PERMISSION_READ         (1 << 1)
84 #define PERMISSION_WRITE        (1 << 2)
85 #define PERMISSION_DELETE       (1 << 3)
86 #define PERMISSION_NOTIFY       (1 << 4)
87 #define PERMISSION_FULL_CONTROL (PERMISSION_CREATE | \
88                                  PERMISSION_READ | \
89                                  PERMISSION_WRITE | \
90                                  PERMISSION_DELETE | \
91                                  PERMISSION_NOTIFY)
92
93 /**
94  * @brief   Response type for all Action requests from CA layer;
95  *          may include a reason code.
96  *
97  * To extract codes use GetReasonCode function on SRMAccessResponse:
98  *
99  * SRMAccessResponse_t response = SRMRequestHandler(obj, info);
100  * if(SRM_TRUE == IsAccessGranted(response)) {
101  *     SRMAccessResponseReasonCode_t reason = GetReasonCode(response);
102  *     switch(reason) {
103  *         case INSUFFICIENT_PERMISSION:
104  *         ...etc.
105  *     }
106  * }
107  */
108 typedef enum
109 {
110     ACCESS_GRANTED = ACCESS_GRANTED_DEF,
111     ACCESS_DENIED = ACCESS_DENIED_DEF,
112     ACCESS_DENIED_INVALID_PERIOD = ACCESS_DENIED_DEF
113         | INVALID_PERIOD_DEF,
114     ACCESS_DENIED_INSUFFICIENT_PERMISSION = ACCESS_DENIED_DEF
115         | INSUFFICIENT_PERMISSION_DEF,
116     ACCESS_DENIED_SUBJECT_NOT_FOUND = ACCESS_DENIED_DEF
117         | SUBJECT_NOT_FOUND_DEF,
118     ACCESS_DENIED_RESOURCE_NOT_FOUND = ACCESS_DENIED_DEF
119         | RESOURCE_NOT_FOUND_DEF,
120     ACCESS_DENIED_POLICY_ENGINE_ERROR = ACCESS_DENIED_DEF
121         | POLICY_ENGINE_ERROR_DEF,
122     ACCESS_WAITING_FOR_AMS = ACCESS_WAITING_DEF
123         | AMS_SERVICE_DEF,
124     ACCESS_DENIED_AMS_SERVICE_ERROR = ACCESS_DENIED
125         | AMS_SERVICE_DEF
126 } SRMAccessResponse_t;
127
128 /**
129  * Reason code for SRMAccessResponse.
130  */
131 typedef enum
132 {
133     NO_REASON_GIVEN = 0,
134     INSUFFICIENT_PERMISSION = INSUFFICIENT_PERMISSION_DEF,
135     SUBJECT_NOT_FOUND = SUBJECT_NOT_FOUND_DEF,
136     RESOURCE_NOT_FOUND = RESOURCE_NOT_FOUND_DEF,
137 } SRMAccessResponseReasonCode_t;
138
139 /**
140  * Extract Reason Code from Access Response.
141  */
142 static inline SRMAccessResponseReasonCode_t GetReasonCode(
143     SRMAccessResponse_t response)
144 {
145     SRMAccessResponseReasonCode_t reason =
146         (SRMAccessResponseReasonCode_t)(response & REASON_MASK_DEF);
147     return reason;
148 }
149
150 /**
151  * Returns 'true' iff request should be passed on to RI layer.
152  */
153 static inline bool IsAccessGranted(SRMAccessResponse_t response)
154 {
155     if(ACCESS_GRANTED == (response & ACCESS_GRANTED))
156     {
157         return true;
158     }
159     else
160     {
161         return false;
162     }
163 }
164
165 typedef struct OicSecRsrc OicSecRsrc_t;
166
167 typedef struct OicSecValidity OicSecValidity_t;
168
169 typedef struct OicSecAce OicSecAce_t;
170
171 typedef struct OicSecAcl OicSecAcl_t;
172
173 typedef struct OicSecAmacl OicSecAmacl_t;
174
175 typedef struct OicSecCred OicSecCred_t;
176
177 /**
178  * Aid for assigning/testing vals with OicSecCredType_t.
179  * Example:
180  *  OicSecCredType_t ct = PIN_PASSWORD | ASYMMETRIC_KEY;
181  *  if((ct & PIN_PASSWORD) == PIN_PASSWORD)
182  *  {
183  *      // ct contains PIN_PASSWORD flag.
184  *  }
185  */
186 typedef enum OSCTBitmask
187 {
188     NO_SECURITY_MODE                = 0x0,
189     SYMMETRIC_PAIR_WISE_KEY         = (0x1 << 0),
190     SYMMETRIC_GROUP_KEY             = (0x1 << 1),
191     ASYMMETRIC_KEY                  = (0x1 << 2),
192     SIGNED_ASYMMETRIC_KEY           = (0x1 << 3),
193     PIN_PASSWORD                    = (0x1 << 4),
194     ASYMMETRIC_ENCRYPTION_KEY       = (0x1 << 5),
195 } OSCTBitmask_t;
196
197 /**
198  * /oic/sec/credtype (Credential Type) data type.
199  * Derived from OIC Security Spec /oic/sec/cred; see Spec for details.
200  *              0:  no security mode
201  *              1:  symmetric pair-wise key
202  *              2:  symmetric group key
203  *              4:  asymmetric key
204  *              8:  signed asymmetric key (aka certificate)
205  *              16: PIN /password
206  */
207 typedef OSCTBitmask_t OicSecCredType_t;
208
209 typedef struct OicSecDoxm OicSecDoxm_t;
210
211 typedef enum OicSecDpm
212 {
213     NORMAL                          = 0x0,
214     RESET                           = (0x1 << 0),
215     TAKE_OWNER                      = (0x1 << 1),
216     BOOTSTRAP_SERVICE               = (0x1 << 2),
217     SECURITY_MANAGEMENT_SERVICES    = (0x1 << 3),
218     PROVISION_CREDENTIALS           = (0x1 << 4),
219     PROVISION_ACLS                  = (0x1 << 5),
220     // << 6 THROUGH 15 RESERVED
221 } OicSecDpm_t;
222
223 typedef enum OicSecDpom
224 {
225     MULTIPLE_SERVICE_SERVER_DRIVEN  = 0x0,
226     SINGLE_SERVICE_SERVER_DRIVEN    = 0x1,
227     MULTIPLE_SERVICE_CLIENT_DRIVEN  = 0x2,
228     SINGLE_SERVICE_CLIENT_DRIVEN    = 0x3,
229 } OicSecDpom_t;
230
231 typedef enum OicSecSvcType
232 {
233     SERVICE_UNKNOWN                 = 0x0,
234     ACCESS_MGMT_SERVICE             = 0x1,  //urn:oic.sec.ams
235 } OicSecSvcType_t;
236
237
238 //TODO: Need more clarification on deviceIDFormat field type.
239 #if 0
240 typedef enum
241 {
242     URN = 0x0
243 }OicSecDvcIdFrmt_t;
244 #endif
245
246 typedef enum
247 {
248     OIC_R_ACL_TYPE = 0,
249     OIC_R_AMACL_TYPE,
250     OIC_R_CRED_TYPE,
251     OIC_R_CRL_TYPE,
252     OIC_R_DOXM_TYPE,
253     OIC_R_DPAIRING_TYPE,
254     OIC_R_PCONF_TYPE,
255     OIC_R_PSTAT_TYPE,
256     OIC_R_SACL_TYPE,
257     OIC_R_SVC_TYPE,
258     OIC_SEC_SVR_TYPE_COUNT, //define the value to number of SVR
259     NOT_A_SVR_RESOURCE = 99
260 }OicSecSvrType_t;
261
262 typedef enum
263 {
264     OIC_JUST_WORKS                          = 0x0,
265     OIC_RANDOM_DEVICE_PIN                   = 0x1,
266     OIC_MANUFACTURER_CERTIFICATE           = 0x2,
267     OIC_OXM_COUNT
268 }OicSecOxm_t;
269
270 typedef enum
271 {
272     OIC_ENCODING_UNKNOW = 0,
273     OIC_ENCODING_RAW = 1,
274     OIC_ENCODING_BASE64 = 2
275 }OicEncodingType_t;
276
277 typedef struct OicSecKey OicSecKey_t;
278
279 typedef struct OicSecPstat OicSecPstat_t;
280
281 typedef struct OicSecRole OicSecRole_t;
282
283 typedef struct OicSecSacl OicSecSacl_t;
284
285 typedef struct OicSecSvc OicSecSvc_t;
286
287 typedef char *OicUrn_t; //TODO is URN type defined elsewhere?
288
289 typedef struct OicUuid OicUuid_t; //TODO is UUID type defined elsewhere?
290
291
292 #ifdef __WITH_X509__
293 typedef struct OicSecCrl OicSecCrl_t;
294 typedef ByteArray OicSecCert_t;
295 #else
296 typedef void OicSecCert_t;
297 #endif /* __WITH_X509__ */
298
299 /**
300  * /oic/uuid (Universal Unique Identifier) data type.
301  */
302 #define UUID_LENGTH 128/8 // 128-bit GUID length
303 //TODO: Confirm the length and type of ROLEID.
304 #define ROLEID_LENGTH 128/8 // 128-bit ROLEID length
305 #define OWNER_PSK_LENGTH_128 128/8 //byte size of 128-bit key size
306 #define OWNER_PSK_LENGTH_256 256/8 //byte size of 256-bit key size
307
308 struct OicUuid
309 {
310     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
311     //TODO fill in unless this is defined elsewhere?
312     uint8_t             id[UUID_LENGTH];
313 };
314
315 /**
316  * /oic/sec/jwk (JSON Web Key) data type.
317  * See JSON Web Key (JWK)  draft-ietf-jose-json-web-key-41
318  */
319 #define JWK_LENGTH 256/8 // 256 bit key length
320 struct OicSecKey
321 {
322     uint8_t                *data;
323     size_t                  len;
324
325     // TODO: This field added as workaround. Will be replaced soon.
326     OicEncodingType_t encoding;
327
328 };
329
330 struct OicSecRsrc
331 {
332     char *href; // 0:R:S:Y:String
333     char *rel; // 1:R:S:N:String
334     char** types; // 2:R:S:N:String Array
335     size_t typeLen; // the number of elts in types
336     char** interfaces; // 3:R:S:N:String Array
337     size_t interfaceLen; // the number of elts in interfaces
338     OicSecRsrc_t *next;
339 };
340
341 struct OicSecValidity
342 {
343     char* period; // 0:R:S:Y:String
344     char** recurrences; // 1:R:M:Y:Array of String
345     size_t recurrenceLen; // the number of elts in recurrence
346     OicSecValidity_t *next;
347 };
348
349 struct OicSecAce
350 {
351     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
352     OicUuid_t subjectuuid; // 0:R:S:Y:uuid
353     OicSecRsrc_t *resources; // 1:R:M:Y:Resource
354     uint16_t permission; // 2:R:S:Y:UINT16
355     OicSecValidity_t *validities; // 3:R:M:N:Time-interval
356     OicSecAce_t *next;
357 };
358
359 /**
360  * /oic/sec/acl (Access Control List) data type.
361  * Derived from OIC Security Spec; see Spec for details.
362  */
363 struct OicSecAcl
364 {
365     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
366     OicUuid_t           rownerID;        // 0:R:S:Y:oic.uuid
367     OicSecAce_t         *aces; // 1:R:M:N:ACE
368 };
369
370 /**
371  * /oic/sec/amacl (Access Manager Service Accesss Control List) data type.
372  * Derived from OIC Security Spec; see Spec for details.
373  */
374 struct OicSecAmacl
375 {
376     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
377     size_t              resourcesLen;   // the number of elts in Resources
378     char                **resources;    // 0:R:M:Y:String
379     size_t              amssLen;        // the number of elts in Amss
380     OicUuid_t           *amss;          // 1:R:M:Y:acl
381     OicUuid_t           rownerID;        // 2:R:S:Y:oic.uuid
382     OicSecAmacl_t         *next;
383 };
384
385 /**
386  * /oic/sec/cred (Credential) data type.
387  * Derived from OIC Security Spec; see Spec for details.
388  */
389 struct OicSecCred
390 {
391     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
392     uint16_t            credId;         // 0:R:S:Y:UINT16
393     OicUuid_t           subject;        // 1:R:S:Y:oic.uuid
394     //Note: Need further clarification on roleID data type
395     //NOTE: Need further clarification on roleId datatype.
396     //size_t              roleIdsLen;     // the number of elts in RoleIds
397     //OicSecRole_t        *roleIds;       // 2:R:M:N:oic.sec.role
398     OicSecCredType_t    credType;       // 3:R:S:Y:oic.sec.credtype
399 #ifdef __WITH_X509__
400     OicSecCert_t        publicData;     // chain of certificates
401 #endif /* __WITH_X509__ */
402     OicSecKey_t         privateData;    // 6:R:S:N:oic.sec.key
403     char                *period;        // 7:R:S:N:String
404     OicUuid_t           rownerID;        // 8:R:S:Y:oic.uuid
405     OicSecCred_t        *next;
406 };
407
408 /**
409  * /oic/sec/doxm (Device Owner Transfer Methods) data type
410  * Derived from OIC Security Spec; see Spec for details.
411  */
412 struct OicSecDoxm
413 {
414     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
415     OicUrn_t            *oxmType;       // 0:R:M:N:URN
416     size_t              oxmTypeLen;     // the number of elts in OxmType
417     OicSecOxm_t         *oxm;           // 1:R:M:N:UINT16
418     size_t              oxmLen;         // the number of elts in Oxm
419     OicSecOxm_t         oxmSel;         // 2:R/W:S:Y:UINT16
420     OicSecCredType_t    sct;            // 3:R:S:Y:oic.sec.credtype
421     bool                owned;          // 4:R:S:Y:Boolean
422     //TODO: Need more clarification on deviceIDFormat field type.
423     //OicSecDvcIdFrmt_t   deviceIDFormat; // 5:R:S:Y:UINT8
424     OicUuid_t           deviceID;       // 6:R:S:Y:oic.uuid
425     bool                dpc;            // 7:R:S:Y:Boolean
426     OicUuid_t           owner;          // 8:R:S:Y:oic.uuid
427     OicUuid_t           rownerID;       // 9:R:S:Y:oic.uuid
428 };
429
430 /**
431  * /oic/sec/pstat (Provisioning Status) data type.
432  * NOTE: this struct is ahead of Spec v0.95 in definition to include Sm.
433  * TODO: change comment when reconciled to Spec v0.96.
434  */
435 struct OicSecPstat
436 {
437     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
438     bool                isOp;           // 0:R:S:Y:Boolean
439     OicSecDpm_t         cm;             // 1:R:S:Y:oic.sec.dpm
440     OicSecDpm_t         tm;             // 2:RW:S:Y:oic.sec.dpm
441     OicUuid_t           deviceID;       // 3:R:S:Y:oic.uuid
442     OicSecDpom_t        om;             // 4:RW:M:Y:oic.sec.dpom
443     size_t              smLen;          // the number of elts in Sm
444     OicSecDpom_t        *sm;            // 5:R:M:Y:oic.sec.dpom
445     uint16_t            commitHash;     // 6:R:S:Y:oic.sec.sha256
446     OicUuid_t           rownerID;       // 7:R:S:Y:oic.uuid
447 };
448
449 /**
450  * /oic/sec/role (Role) data type.
451  * Derived from OIC Security Spec; see Spec for details.
452  */
453 struct OicSecRole
454 {
455     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
456     //TODO fill in with Role definition
457     uint8_t             id[ROLEID_LENGTH];
458 };
459
460 /**
461  * /oic/sec/sacl (Signed Access Control List) data type.
462  * Derived from OIC Security Spec; see Spec for details.
463  */
464 struct OicSecSacl
465 {
466     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
467     //TODO fill in from OIC Security Spec
468 };
469
470 /**
471  * /oic/sec/svc (Service requiring a secure connection) data type.
472  * Derived from OIC Security Spec; see Spec for details.
473  */
474 struct OicSecSvc
475 {
476     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
477     OicUuid_t               svcdid;                 //0:R:S:Y:oic.uuid
478     OicSecSvcType_t         svct;                   //1:R:M:Y:OIC Service Type
479     size_t                  ownersLen;              //2:the number of elts in Owners
480     OicUuid_t               *owners;                //3:R:M:Y:oic.uuid
481     OicSecSvc_t             *next;
482 };
483
484 #ifdef __WITH_X509__
485 struct OicSecCrl
486 {
487     uint16_t CrlId;
488     ByteArray ThisUpdate;
489     ByteArray CrlData;
490 };
491 #endif /* __WITH_X509__ */
492
493 /**
494  * @brief   direct pairing data type
495  */
496 typedef struct OicPin OicDpPin_t;
497
498 typedef struct OicSecPdAcl OicSecPdAcl_t;
499
500 typedef struct OicSecPconf OicSecPconf_t;
501
502 typedef struct OicSecDpairing OicSecDpairing_t;
503
504 #define DP_PIN_LENGTH 8 // temporary length
505
506 /**
507  * @brief   /oic/sec/prmtype (Pairing Method Type) data type.
508  *              0:  not allowed
509  *              1:  pre-configured pin
510  *              2:  random pin
511  */
512 typedef enum PRMBitmask
513 {
514     PRM_NOT_ALLOWED             = 0x0,
515     PRM_PRE_CONFIGURED        = (0x1 << 0),
516     PRM_RANDOM_PIN               = (0x1 << 1),
517 } PRMBitmask_t;
518
519 typedef PRMBitmask_t OicSecPrm_t;
520
521
522 struct OicPin
523 {
524     uint8_t             val[DP_PIN_LENGTH];
525 };
526
527 /**
528  * @brief   oic.sec.dpacltype (Device Pairing Access Control List) data type.
529  */
530 struct OicSecPdAcl
531 {
532     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
533     char                  **resources;        // 0:R:M:Y:String
534     size_t                resourcesLen;      // the number of elts in Resources
535     uint16_t             permission;        // 1:R:S:Y:UINT16
536     char                  **periods;            // 2:R:M*:N:String (<--M*; see Spec)
537     char                  **recurrences;    // 3:R:M:N:String
538     size_t                prdRecrLen;         // the number of elts in Periods/Recurrences
539     OicSecPdAcl_t    *next;
540 };
541
542 /**
543  * @brief   /oic/sec/pconf (Pairing Configuration) data type
544  */
545 struct OicSecPconf
546 {
547     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
548     bool                  edp;                // 0:W:S:M:Boolean
549     OicSecPrm_t      *prm;              // 1:R:M:N:UINT16
550     size_t                prmLen;          // the number of elts in Prm
551     OicDpPin_t          pin;               // 2:R:S:Y:String
552     OicSecPdAcl_t    *pdacls;         // 3:R:M:Y:oic.sec.pdacltype
553     OicUuid_t           *pddevs;        // 4:R:M:Y:oic.uuid
554     size_t                 pddevLen;     // the number of elts in pddev
555     OicUuid_t           deviceID;       // 5:R:S:Y:oic.uuid
556     OicUuid_t           rownerID;          // 6:R:S:Y:oic.uuid
557 };
558
559 /**
560  * @brief   /oic/sec/dpairing (Device Pairing) data type
561  */
562 struct OicSecDpairing
563 {
564     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
565     OicSecPrm_t      spm;               // 0:R/W:S:Y:UINT16
566     OicUuid_t           pdeviceID;     // 1:R:S:Y:oic.uuid
567     OicUuid_t           rownerID;          // 2:R:S:Y:oic.uuid
568 };
569
570 #define MAX_VERSION_LEN 16 // Security Version length. i.e., 00.00.000 + reserved space
571
572 /**
573  * @brief   security version data type
574  */
575 typedef struct OicSecVer OicSecVer_t;
576
577 /**
578  * @brief   /oic/sec/ver (Security Version) data type
579  */
580 struct OicSecVer
581 {
582     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
583     char              secv[MAX_VERSION_LEN];          // 0:R:S:Y:String
584     OicUuid_t       deviceID;     // 1:R:S:Y:oic.uuid
585 };
586
587 #ifdef __cplusplus
588 }
589 #endif
590
591 #endif //OC_SECURITY_RESOURCE_TYPES_H