In preparation for a future LMDB KDB module, we would like to move the principal and policy entry serialization code into libkdb5, so that it can be shared between the DB2 and LMDB modules. Currently this code is internal to the DB2 KDB module.