IoTeX client
signer.h
1#ifndef IOTEX_SIGNER_H
2#define IOTEX_SIGNER_H
3
4#include "IoTeXConstants.h"
5#include "IoTeXResultCodes.h"
6#include <stddef.h>
7#include <stdint.h>
8
9namespace iotex
10{
11class Signer
12{
13 public:
14 void getHash(const uint8_t* pData, size_t size, uint8_t hash[IOTEX_HASH_SIZE]);
15 void getEthereumMessageHash(const uint8_t* pMsg, size_t length, uint8_t hash[IOTEX_HASH_SIZE]);
16
17 void getPublicKey(const uint8_t privateKey[IOTEX_PRIVATE_KEY_SIZE],
18 uint8_t publicKey[IOTEX_PUBLIC_KEY_SIZE]);
19
20 ResultCode getSignature(const uint8_t* data, size_t size,
21 const uint8_t private_key[IOTEX_PRIVATE_KEY_SIZE],
22 uint8_t signature[IOTEX_SIGNATURE_SIZE]);
23
24 ResultCode signHash(const uint8_t hash[IOTEX_HASH_SIZE],
25 const uint8_t private_key[IOTEX_PRIVATE_KEY_SIZE],
26 uint8_t signature[IOTEX_SIGNATURE_SIZE]);
27
28 void signMessage(const uint8_t* message, size_t size,
29 const uint8_t privateKey[IOTEX_PRIVATE_KEY_SIZE],
30 uint8_t signature[IOTEX_SIGNATURE_SIZE]);
31
32 ResultCode hex2str(const uint8_t* hex, size_t hex_size, char* str, size_t str_size);
33 ResultCode str2hex(const char* str, uint8_t* hex, size_t size);
34
35 private:
36};
37} // namespace iotex
38
39extern iotex::Signer signer;
40
41#endif
Definition: signer.h:12
Definition: abi.h:12