Former National Enquirer publisher David Pecker said in court he knew he was violating campaign finance law when he made payments to hide damaging information about Donald Trump in 2016.