some mockCA code, still need to incorporate session key encryption