Is there a way to set TCP options using the sockets API?

I am relatively new to socket programming so this may sound like a very lame question.
I have to use authenticated TCP(MD5 as a TCP option to start with) as a transport for some application. I was wondering if this could be done using the sockets API or there is some other form of an existing TCP APIs that I could use to do the same. I would appreciate if I could get some help with this.

Is there a way to set TCP options using the sockets API?