`InvalidKeyError` now expects the class and the serialized key as arguments, to give a nicer error message.