You're right. To make the whole purpose of a smart card to keep secret keys safe. If your application is running on Windows, you can try to use WININET.DLL to connect, if the middleware is installed correctly, it should automatically process authentication on the CAC website.
source share