This is an example of how to call the SDK member APIs.
#include <stdlib.h>
#include <string.h>
#include "src/signmsg.h"
#include "src/prng.h"
#include "util/envutil.h"
#include "util/stdtypes.h"
#include "util/buffutil.h"
bool IsCaCertAuthorizedByRootCa(void const* data, size_t size) {
(void)data;
(void)size;
return true;
}
EpidStatus SignMsg(
void const* msg,
size_t msg_len,
void const* basename,
size_t basename_len, unsigned char const* signed_sig_rl,
size_t signed_sig_rl_size,
unsigned char const* signed_pubkey,
size_t signed_pubkey_size, unsigned char const* priv_key_ptr,
size_t privkey_size,
HashAlg hash_alg,
void* prng = NULL;
size_t sig_rl_size = 0;
do {
if (!sig) {
break;
}
&pub_key);
break;
}
if (signed_sig_rl) {
sig_rl, &sig_rl_size);
break;
}
break;
}
sig_rl = AllocBuffer(sig_rl_size);
if (!sig_rl) {
break;
}
sig_rl, &sig_rl_size);
break;
}
break;
}
}
sts = PrngCreate(&prng);
break;
}
if (privkey_size ==
sizeof(
PrivKey)) {
priv_key = *(
PrivKey*)priv_key_ptr;
&priv_key);
break;
}
} else {
break;
}
member_precomp_is_input ? member_precomp : NULL,
PrngGen, prng, &member);
break;
}
break;
}
if (0 != basename_len) {
break;
}
}
break;
}
*sig = AllocBuffer(*sig_len);
if (!*sig) {
break;
}
sts =
EpidSign(member, msg, msg_len, basename, basename_len, sig_rl,
sig_rl_size, *sig, *sig_len);
break;
}
} while (0);
PrngDelete(&prng);
if (sig_rl) free(sig_rl);
return sts;
}