corrected deinitialisation of public key factory