Perhaps this method should just raise `InvalidKeyError` directly, if it can't parse, since that seems to be the behavior of all of its callers.