Apple’s legal battle with the government tests the limits of law enforcement agencies’ access to personal data.