title: Access restriction on sun.security.pkcs11.SunPKCS11
body: <p>I'm trying to setup a PKCS11 provider for accessing a smartcard.
  I installed a PKCS11 library on my system and followed the instructions in the <a href="http://download.oracle.com/javase/1.5.0/docs/guide/security/p11guide.html" rel="noreferrer" title="Java PKCS#11 Reference Guide">Java PKCS#11 Reference Guide</a>.
  In the reference they simply create an instance of <code>sun.security.pkcs11.SunPKCS11</code> and pass the name of the configuration file to the constructor.
  When I try to compile the following code</p>
  
  <pre><code>Provider p = new sun.security.pkcs11.SunPKCS11("pkcs11.cfg");
  Security.addProvider(p);
  </code></pre>
  
  <p>I get the following error.  </p>
  
  <blockquote>
    <p>Access restriction: The constructor SunPKCS11(String) is not accessible due to restriction on required library /usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/ext/sunpkcs11.jar</p>
  </blockquote>
  
  <p>What am I doing wrong?
  I use Eclipse 3.5 with Java SE 1.6 under Ubuntu x86.</p>
  
  <p>Best regards. </p>