data-types.h
1 
21 #ifndef NDN_DATA_TYPES_H
22 #define NDN_DATA_TYPES_H
23 
24 #include "key-types.h"
25 #include "publisher-public-key-digest-types.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 typedef enum {
35  ndn_ContentType_BLOB = 0,
36  // ContentType DATA is deprecated. Use ndn_ContentType_BLOB.
37  ndn_ContentType_DATA = 0,
38  ndn_ContentType_LINK = 1,
39  ndn_ContentType_KEY = 2,
40  // ContentType ENCR, GONE and NACK are not supported in NDN-TLV encoding and are deprecated.
41  ndn_ContentType_ENCR = 3,
42  ndn_ContentType_GONE = 4,
43  ndn_ContentType_NACK = 5
44 } ndn_ContentType;
45 
50 typedef enum {
51  ndn_SignatureType_DigestSha256Signature = 0,
52  ndn_SignatureType_Sha256WithRsaSignature = 1,
53  ndn_SignatureType_Sha256WithEcdsaSignature = 3,
54  ndn_SignatureType_HmacWithSha256Signature = 4
55 } ndn_SignatureType;
56 
64 struct ndn_Signature {
65  ndn_SignatureType type;
68  struct ndn_Blob witness;
69  struct ndn_Blob signature;
73  struct ndn_KeyLocator keyLocator;
74 };
75 
79 struct ndn_MetaInfo {
80  ndn_MillisecondsSince1970 timestampMilliseconds;
81  ndn_ContentType type;
82  ndn_Milliseconds freshnessPeriod;
84 };
85 
86 struct ndn_Data {
87  struct ndn_Signature signature;
88  struct ndn_Name name;
89  struct ndn_MetaInfo metaInfo;
90  struct ndn_Blob content;
91 };
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif
struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest
Definition: data-types.h:72
ndn_MillisecondsSince1970 timestampMilliseconds
milliseconds since 1/1/1970.
Definition: data-types.h:80
ndn_ContentType type
default is ndn_ContentType_DATA.
Definition: data-types.h:81
Definition: data-types.h:86
struct ndn_Blob content
A Blob with a pointer to the content.
Definition: data-types.h:90
struct ndn_Blob witness
A Blob whose value is a pointer to pre-allocated buffer.
Definition: data-types.h:68
Copyright (C) 2015 Regents of the University of California.
Definition: publisher-public-key-digest-types.h:34
ndn_SignatureType type
-1 for none
Definition: data-types.h:65
An ndn_KeyLocator holds the type of key locator and related data.
Definition: key-types.h:51
struct ndn_NameComponent finalBlockId
has a pointer to a pre-allocated buffer.
Definition: data-types.h:83
Copyright (C) 2015 Regents of the University of California.
Definition: name-types.h:33
An ndn_MetaInfo struct holds the meta info which is signed inside the data packet.
Definition: data-types.h:79
An ndn_Name holds an array of ndn_NameComponent.
Definition: name-types.h:40
Copyright (C) 2015 Regents of the University of California.
Definition: blob-types.h:33
ndn_Milliseconds freshnessPeriod
-1 for none
Definition: data-types.h:82
An ndn_Signature struct holds the signature bits and other info representing the signature in a data ...
Definition: data-types.h:64
struct ndn_Blob digestAlgorithm
A Blob whose value is a pointer to a pre-allocated buffer.
Definition: data-types.h:66