ec-public-key.h
1 
21 #ifndef NDN_EC_PUBLIC_KEY_H
22 #define NDN_EC_PUBLIC_KEY_H
23 
24 #include <ndn-cpp/c/common.h>
25 #include <ndn-cpp/c/errors.h>
26 #include <ndn-cpp/c/security/ec-public-key-types.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 static __inline void
37 ndn_EcPublicKey_initialize(struct ndn_EcPublicKey *self)
38 {
39  self->publicKey = 0;
40 }
41 
46 void
47 ndn_EcPublicKey_finalize(struct ndn_EcPublicKey *self);
48 
58 ndn_Error
59 ndn_EcPublicKey_decode
60  (struct ndn_EcPublicKey *self, const uint8_t *publicKeyDer,
61  size_t publicKeyDerLength);
62 
77 ndn_Error
78 ndn_EcPublicKey_encode
79  (const struct ndn_EcPublicKey *self, int includeParameters, uint8_t *encoding,
80  size_t *encodingLength);
81 
91 int
92 ndn_EcPublicKey_verifyWithSha256
93  (const struct ndn_EcPublicKey *self, const uint8_t *signature,
94  size_t signatureLength, const uint8_t *data, size_t dataLength);
95 
109 ndn_Error
110 ndn_verifySha256WithEcdsaSignature
111  (const uint8_t *signature, size_t signatureLength, const uint8_t *data,
112  size_t dataLength, const uint8_t *publicKeyDer, size_t publicKeyDerLength,
113  int *verified);
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif
A struct ndn_EcPublicKey holds a decoded EC public key for use in crypto operations.
Definition: ec-public-key-types.h:34