Maybe something simpler, without sqlite, written in C for the smaller target trying to use tpm2 as a pkcs11 store?