I am trying to create an IRC client-like thing in Java. However, one of my requirements is this:

I need to be able to see the server certificate in the script and verify it against a file copy, and I need to be able to send a certificate that is stored in a file.

Any help on how to do this would be appreciated. I have read everything I can find on JSSE and can't figure it out.