More test cases. fixed issues with zero length encryption. added check for untrusted public keys. added trust unit tests. fixed issue with rekey function.