reworked KeyPolicy class, added KeyPolicyException class