A judge in Perry County has been charged with sexually assaulting a 12-year-old boy, Pennsylvania Attorney General Josh Shapiro announced Tuesday.