Set the code to a randomly generated one if we are previewing the custom certificate