Queries on Encrypted Data Library

The following types can be serialized and deserialized:

HVE_t
QEDPrivateKey_t
QEDPublicKey_t
QEDToken_t
QEDEncryption_t
QEDMessageKey_t
Functions to serialize type HVE_t: Similarly we have...

Functions to serialize QEDPrivateKey_t: Functions to serialize QEDPublicKey_t: Functions to serialize QEDToken_t: Functions to serialize QEDEncryption_t: Functions to serialize QEDMessageKey_t *Msg:

You can also read/write these types to a file, using writeFile and readFile:

int readFile(const char *fileName, unsigned char **bytes, unsigned *numBytes);

int writeFile(const char *fileName, const unsigned char *bytes, unsigned numBytes);
Here is an example of serializing a QEDPublicKey_t type and exporting it to a file:
  QEDPublicKey_t PubKey;
  uint8_t *bytes;
  size_t bytes_len;

  bytes_len = byte_count_PubKey(&PubKey);
  bytes = calloc(sizeof(uint8_t), bytes_len);
  bytes_len = serialize_PubKey(&PubKey, bytes);
  if(writeFile(PubKeyFile, bytes, bytes_len)) {
    printf("Cannot export public key to file %s\n", PubKeyFile);
    exit(1);
  }
  free(bytes);
And here is an example of importing data and deserializing it to a QEDPublicKey_t type:
  QEDPublicKey_t PubKey;
  uint8_t *bytes;
  size_t bytes_len;
   
  if(readFile(PubKeyFile, &bytes, &bytes_len)) {
    printf("Cannot import public key from file %s\n", PubKeyFile);
  }
  bytes_len = deserialize_PubKey(&PubKey, bytes);
  free(bytes);