Unexpected diagnosis

Yesterday I found out I have type 2 herpes. My doctor told me that it is a sexually transmitted disease but my boyfriend & I have been together for over a year now & I’ve NEVER had this issue before in the time that we have been having sex. I’ve been faithful & he has too. Is it possible to have gotten herpes from public washrooms or public surfaces? I am so confused as to how this has happened. Also I did use a shaver/razor down there recently that might not have been sterilized properly. Could that have caused this as well?