Jamshed Dasti - The Other Side

He didn’t produce a fake degree. That was issued by some Islamic institute. Honorable conducted an examination in court room and he failed. He was threatened to be sent in jail so he resigned.
I knew that all what they asked but I am sure if I am at a forum like S.C. and in that situation may be I fail.
Were they entitled to conduct such exam ?