ec-private-key.h
1 
21 #ifndef NDN_EC_PRIVATE_KEY_H
22 #define NDN_EC_PRIVATE_KEY_H
23 
24 #include <ndn-cpp/c/common.h>
25 #include <ndn-cpp/c/errors.h>
26 #include <ndn-cpp/c/security/ec-private-key-types.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 static __inline void
37 ndn_EcPrivateKey_initialize(struct ndn_EcPrivateKey *self)
38 {
39  self->privateKey = 0;
40 }
41 
46 void
47 ndn_EcPrivateKey_finalize(struct ndn_EcPrivateKey *self);
48 
58 ndn_Error
59 ndn_EcPrivateKey_decode
60  (struct ndn_EcPrivateKey *self, const uint8_t *privateKeyDer,
61  size_t privateKeyDerLength);
62 
74 ndn_Error
75 ndn_EcPrivateKey_setByCurve
76  (struct ndn_EcPrivateKey *self, int curveId, const uint8_t *value,
77  size_t valueLength);
78 
88 ndn_Error
89 ndn_EcPrivateKey_generate(struct ndn_EcPrivateKey *self, uint32_t keySize);
90 
105 ndn_Error
106 ndn_EcPrivateKey_encodePrivateKey
107  (const struct ndn_EcPrivateKey *self, int includeParameters, uint8_t *encoding,
108  size_t *encodingLength);
109 
124 ndn_Error
125 ndn_EcPrivateKey_encodePublicKey
126  (const struct ndn_EcPrivateKey *self, int includeParameters, uint8_t *encoding,
127  size_t *encodingLength);
128 
141 ndn_Error
142 ndn_EcPrivateKey_signWithSha256
143  (const struct ndn_EcPrivateKey *self, const uint8_t *data, size_t dataLength,
144  uint8_t *signature, size_t *signatureLength);
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif
A struct ndn_EcPrivateKey holds a decoded EC private key for use in crypto operations.
Definition: ec-private-key-types.h:34