code: public int initPKCS11(PKCS11Configuration configuration, String kspassword)
  		throws IOException, KeyStoreException,
  			CertificateException, NoSuchAlgorithmException,
  			ClassNotFoundException, SecurityException, NoSuchMethodException,
  			IllegalArgumentException, InstantiationException,
  			IllegalAccessException, InvocationTargetException {
  
  		if (!isProviderAvailable(PKCS11_PROVIDER_TYPE)) {
  			return -1;
  		}
  
  		Provider pkcs11 = createPKCS11Provider(configuration);
  
          Security.addProvider(pkcs11);
  
  		// init the key store
  		KeyStore ks = getPKCS11KeyStore(pkcs11.getName());
  		ks.load(null, kspassword == null ? null : kspassword.toCharArray());
  		return addKeyStore(ks, "PKCS#11: " + configuration.getName(), ""); // do not store pin code
  	}
docs: /*
  public int initCryptoApi() throws KeyStoreException,
  NoSuchAlgorithmException, CertificateException, IOException{
  
  Provider mscapi = new sun.security.mscapi.SunMSCAPI();
  Security.addProvider(mscapi);
  
  KeyStore ks = KeyStore.getInstance("Windows-MY"); ks.load(null, null);
  
  return addKeyStore(ks, "CryptoAPI", null); }