A chancre (painless ulcer) could mean you caught syphilis. Once it's healed, you can have syphilis for years without knowing, or spreading it. A blood test is used to check for syphilis.
Tests showing syphilis, chlamydia or gonorrhea are reportable. Medical staff must give your name to the government. You'll be asked for names and phone numbers of sex partners. Anyone you name must, by law, get an STD test! You can be arrested and forced to take treatment.