Updated at 2:47 p.m. ET
Sarah Palin testified Friday against a 22-year-old man accused of hacking into her e-mail account, saying later it's up to the judge to decide whether he should serve prison time if convicted.
Palin testified that the hacking compromised one of the main ways she communicated with her family back in Alaska as she campaigned in 2008 as the Republican vice presidential candidate. Outside the courthouse, when asked whether she thought community service was punishment enough rather than prison, she said, "That's up to the judge."
Former University of Tennessee student David Kernell faces up to 50 years in federal prison if convicted of identity theft, mail fraud and two other felony charges. His lawyer has called the case a prank, not a crime.
Asked outside court if she thought the charges against Kernell were excessive, Palin said, "I don't know, but I do think there should be consequences for bad behavior."
Palin told jurors she was in Michigan campaigning when she first learned from a news report that her e-mail account had been hacked. A few minutes later, her campaign manager and a Secret Service agent told her the report was true, she testified.
The former Alaska governor testified that she used the "gov.palin" Yahoo! account and a Blackberry for almost all communication with her family during the 2008 campaign.
Palin told jurors that she only returned to her home in Wasilla, Alaska, once during the campaign to speak at the ceremony when her son deployed with his Army unit to Iraq.
Palin's husband, Todd, listened as she testified. Their daughter Bristol testified earlier this week that she got harassing calls and text messages after screen shots of e-mail from the account revealed her cell phone number.
A former Palin aide also described receiving vulgar e-mails.
Kernell isn't accused of the harassment. But prosecutors say he improperly gained access to Palin's e-mail account in September 2008 by correctly providing her birth date and ZIP code and correctly answering that Wasilla is where she met her husband.
The intrusion occurred after news reports revealed that Palin had used the private account to discuss some state business with staff.