> False testimony of what?
False testimony of what your password is.
> Can you be compelled to provide testimony that allows a police officer access to your private data?
When under police investigation, you are only allowed to do one of two things: explicitly invoke your 5th amendment right not to provide testimony, or provide truthful testimony of anything the police ask you. Anything else is technically illegal.
> Can a police officer demand I log into my online medical chart so they can complete their investigation?
Yes, though you can refuse their demand by explicitly invoking your 5th ammendemnt right to stay silent. They can legally lie to you about your obligations, though.
> Otherwise every person found guilty of any crime they said they didn't commit would also be found guilty of lying to the police officers who interrogated them.
Indeed, people who proclaim their innocence to police can face additional charges if later found guilty. It's quite rare for this to be pursued in criminal cases, as the additional punishment would not be worth the effort of proving you knowingly lied about this. But it is actually sometimes pursued in misdemeanor cases, as lying to the police is a crime and can actually carry a steeper sentence than the misdemeanor itself, so it can be a powerful incentive to convince you to admit guilt for the lesser charge.
Note: I'm using legal terms rather loosely, and I am probably wrong on some of the details. Perhaps a statement such as "I'm innocent, officer" is too vague to constitute a material falsehood and be prosecutable, even in principle. But something like "I couldn't have killed that man, I was not there that night, I was at this other location" would almost certainly qualify you for additional liability if it can be clearly established that you were in fact at the location the victim was.
> But something like "I couldn't have killed that man, I was not there that night, I was at this other location" would almost certainly qualify you for additional liability if it can be clearly established that you were in fact at the location the victim was.
Exactly. This is important, because even accidental lies can be prosecuted or used as evidence. Imagine yourself panicking under duress with someone asking you rapid fire questions that seem to contradict each other. It’s likely that you will get the facts mixed up.
This is why you need to invoke the 5th and retain an attorney in any situation where someone appears to be asking you questions about a serious crime. For all you know, they may suspect you of some heinous act that you aren’t even aware of.