In a criminal prosecution in which the degree of the crime or the penalty for the crime depends, in whole or in part, on proof of the existence of a prior conviction, if the defendant contests the existence of or factual basis for a prior conviction, proof of it is established by competent and reliable evidence, including a certified court record of the conviction.