Forum Stats

  • 3,838,508 Users
  • 2,262,377 Discussions


CAC applet unable to find acpkcs211.dll

colerick Member Posts: 38
edited Nov 20, 2013 10:45AM in Cryptography

I'm required to develop an applet that can call the ActivClient dll to read a CAC smartcard.

I have a working console version that works perfectly as it references a locally stored config file with the following:

name = myConfig

library = C:\Windows\System32\acpkcs211.dll

but in the applet implementation that config file wouldn't exist on each of the clients.  The actual DLL of course would be required to. 

I'm not much of a java or applet developer. Was handed the working console code and told to make an applet that worked.

How do I access the dll from the signed, Java 1.7, Permissions: all-permissions applet?  I tried the following:

String configName = "name = myConfig"+System.getProperty("line.separator")+"library = C:\\Windows\\System32\\acpkcs211.dll";

acProvider = new;


Start of CACActivApplet Error parsing configuration
    at CACReader.CACReaderActivClient.<init>(
    at CACActivApplet.init(
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$ Source)
    at Source)
Caused by: name = myConfig
library = acpkcs211.dll (The filename, directory name, or volume label syntax is incorrect)
    at Method)

I'm launching it from an SSL'd webserver with the following html.

<applet id="CACApplet" code = "CACActivApplet"
    archive = "CACApplet.jar"
    width = 725
    height = 300>
    <param name="permissions" value="all-permissions" />

Thanks in advance


  • 1055801
    1055801 Member Posts: 2

    There is one problem I see here.  You are supposed to pass config file name with full path to  constructor of .

    For example:

    String configName = "c:/MyDir/pkcs11.cfg";

    Provider p = new;


    Where  pkcs11.cfg content will be this

    name = myConfig

    library = C:\Windows\System32\acpkcs211.dll

    Please refer the following page for more deatils : Java PKCS#11 Reference Guide


    Raghu Nair

  • colerick
    colerick Member Posts: 38

    Yes, that's the problem. In my console app, that is how it works but in an applet that is called from the web, I can't expect that file to exist on every (or even any) client system, can I?  I'd found a post that suggested creating it during execution without actually writing it to the filesystem by using:

    String configName = "name = myConfig"+System.getProperty("line.separator")+"library = C:\\Windows\\System32\\acpkcs211.dll";

    but it doesn't seem to work (maybe it did in an older version of java).  Maybe I could store the config file and/or even the dll inside my applet jar file but I'm not sure how to then reference it.

This discussion has been closed.