YPC  0.2.0
util.h
1 #pragma once
2 
3 #include "ypc/core/byte.h"
4 #include "ypc/core/filesystem.h"
5 #include "ypc/corecommon/nt_cols.h"
6 #include <string>
7 
8 #define PKEY_FILE_NAME_LENGTH 40
9 
10 std::string create_dir_if_not_exist(const std::string &base,
11  const std::string &dir);
12 uint32_t
13 write_key_pair_to_file(const std::string &filename,
14  const ypc::nt<ypc::bytes>::keymgr_key_package_t &key);
15 
16 uint32_t
17 read_key_pair_from_file(const std::string &filename,
18  ypc::nt<ypc::bytes>::keymgr_key_package_t &key);
19 
20 extern "C" {
21 uint32_t ocall_load_key_pair(const char *key_path_name, uint32_t path_size,
22  uint8_t *public_key, uint32_t pkey_size,
23  uint8_t *sealed_private_key, uint32_t sealed_size);
24 }
byte.h