Query has only one step, running QED_Query.
An example is presented at the end.
QED_Query takes in the token, the ciphertext, and the
context. It returns an integer specifying the output
of the query.
int QED_Query( QEDMessageKey_t *M, QEDToken_t *Token, QEDEncryption_t *C, QED_CTX *c);
If the MessageKey is populated, then the query returned success. You can use the MessageKey to derive a symmetric key and decrypt data. For more information, please see QED Internals
If the MessageKey is null, then the answer to the query returned failure.
Example
This example builds on top of the example started in the setup section,
and continued in the gentoken and encryption sections.
First, declare a context, a message key, a token and a cipher text variable.
QED_CTX c; QEDMessageKey_t MsgKey; QEDToken_t Token; QEDEncryption_t Cipher;
Second, obtain the token.
-
A file containing a serialized token should have been created at gentoken
time. Read the contents fo this file into an unsigned char buffer, and
use Import/Export functions to deserialize the
variable Token.
Third, obtain the cipher text.
-
A file containing a serialized cipher text should have been created at
encryption
time. Read the contents fo this file into an unsigned char buffer, and
use Import/Export functions to deserialize the
variable Cipher.
Fourth, compute the token.
QED_Query(&MsgKey, &Token, &Cipher, &c);