ndn-lite
signed-interest.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Zhiyi Zhang, Tianyuan Yu
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v3.0. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #ifndef NDN_ENCODING_SIGNED_INTEREST_H
10 #define NDN_ENCODING_SIGNED_INTEREST_H
11 
12 #include "interest.h"
13 #include "../security/ndn-lite-hmac.h"
14 #include "../security/ndn-lite-sha.h"
15 #include "../security/ndn-lite-ecc.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
29 int
31 
42 int
44  const ndn_name_t* identity,
45  const ndn_ecc_prv_t* prv_key);
46 
57 int
59  const ndn_name_t* identity,
60  const ndn_hmac_key_t* hmac_key);
61 
67 int
69 
76 int
78  const ndn_ecc_pub_t* pub_key);
79 
86 int
88  const ndn_hmac_key_t* hmac_key);
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif // NDN_ENCODING_SIGNED_INTEREST_H
int ndn_signed_interest_ecdsa_verify(const ndn_interest_t *interest, const ndn_ecc_pub_t *pub_key)
Verify the ECDSA signature of a decoded Signed Interest.
Definition: signed-interest.c:253
The structure to represent an NDN Interest packet.
Definition: interest.h:31
The structure to keep a HMAC key.
Definition: ndn-lite-hmac.h:65
int ndn_signed_interest_digest_sign(ndn_interest_t *interest)
Use Digest (SHA256) to sign the Interest and encode the Signed Interest into wire format.
Definition: signed-interest.c:187
The structure to keep an ECC private key.
Definition: ndn-lite-ecc.h:86
int ndn_signed_interest_hmac_verify(const ndn_interest_t *interest, const ndn_hmac_key_t *hmac_key)
Verify the HMAC signature of a decoded Signed Interest.
Definition: signed-interest.c:302
The structure to represent the Name.
Definition: name.h:24
int ndn_signed_interest_hmac_sign(ndn_interest_t *interest, const ndn_name_t *identity, const ndn_hmac_key_t *hmac_key)
Use HMAC Algorithm to sign the Interest and encode the Signed Interest into wire format.
Definition: signed-interest.c:122
int ndn_signed_interest_ecdsa_sign(ndn_interest_t *interest, const ndn_name_t *identity, const ndn_ecc_prv_t *prv_key)
Use ECDSA Algorithm to sign the Interest and encode the Signed Interest into wire format.
Definition: signed-interest.c:57
int ndn_signed_interest_digest_verify(const ndn_interest_t *interest)
Verify the Digest (SHA256) signature of a decoded Signed Interest.
Definition: signed-interest.c:350
The structure to keep an ECC public key.
Definition: ndn-lite-ecc.h:71