Judge Dredd (1995) starring Sylvester Stallone.
1 -Only a judge could use the gun, try to use it and you've been electrified. Also the guns had a self-destruction feature. Every police officer was a judge, and hence could act by themselves on the streets.
The majority of humanity resides in huge Mega-Cities, where the traditional justice system has been replaced by a corps of Judges whose role combines those of police officer, judge, jury, and executioner.
2 - Each "judge" had a gun, which appended their DNA to the bullet. This was used later in investigations about a crime scene, and I think was confidential before the trial was held.
5 - When a judge was exiled, they were given a copy of the book of law, and sent outside the city to enlighten the people outside cities.
Dredd is found guilty based on DNA evidence: The Lawgiver encodes the DNA of the wielder onto each round fired, and the DNA from the murder weapon matches Dredd's. Fargo steps down as Chief Judge, asking as his last request that the Council spare Dredd's life. Dredd is sentenced to life imprisonment while Fargo embarks on his "long walk", a tradition in which a retiring Judge ventures into the "Cursed Earth" wasteland "to bring law to the lawless".
3 - Only a judge could use the gun, try to use it and you've been electrified. Also the guns had a self-destruction feature.
This one matche the description of the Lawgiver gun :
A Lawgiver can only be operated by its designated Judge owner, whose palm print is programmed into the gun's memory.
Should an attempt be made by an unauthorised person to use the Lawgiver, it will explode in that person's hand.
4- The main villain was an ex-judge who purchased and activated a very old "killer robot" which was a residue of a long-ended war.
Rico (Armand Assante), a former Judge turned psychopathic murderer, escapes from prison and reclaims his Judge's uniform and "Lawgiver" gun as well as a decommissioned combat robot.