< prev index next >

jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/Secmod.java

Print this page




  28 import java.io.*;
  29 import java.util.*;
  30 
  31 import java.security.*;
  32 import java.security.KeyStore.*;
  33 import java.security.cert.X509Certificate;
  34 
  35 import sun.security.pkcs11.wrapper.*;
  36 import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
  37 
  38 
  39 /**
  40  * The Secmod class defines the interface to the native NSS
  41  * library and the configuration information it stores in its
  42  * secmod.db file.
  43  *
  44  * <p>Example code:
  45  * <pre>
  46  *   Secmod secmod = Secmod.getInstance();
  47  *   if (secmod.isInitialized() == false) {
  48  *       secmod.initialize("/home/myself/.mozilla", "/usr/sfw/lib/mozilla");
  49  *   }
  50  *
  51  *   Provider p = secmod.getModule(ModuleType.KEYSTORE).getProvider();
  52  *   KeyStore ks = KeyStore.getInstance("PKCS11", p);
  53  *   ks.load(null, password);
  54  * </pre>
  55  *
  56  * @since   1.6
  57  * @author  Andreas Sterbenz
  58  */
  59 public final class Secmod {
  60 
  61     private final static boolean DEBUG = false;
  62 
  63     private final static Secmod INSTANCE;
  64 
  65     static {
  66         sun.security.pkcs11.wrapper.PKCS11.loadNative();
  67         INSTANCE = new Secmod();
  68     }




  28 import java.io.*;
  29 import java.util.*;
  30 
  31 import java.security.*;
  32 import java.security.KeyStore.*;
  33 import java.security.cert.X509Certificate;
  34 
  35 import sun.security.pkcs11.wrapper.*;
  36 import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
  37 
  38 
  39 /**
  40  * The Secmod class defines the interface to the native NSS
  41  * library and the configuration information it stores in its
  42  * secmod.db file.
  43  *
  44  * <p>Example code:
  45  * <pre>
  46  *   Secmod secmod = Secmod.getInstance();
  47  *   if (secmod.isInitialized() == false) {
  48  *       secmod.initialize("/home/myself/.mozilla");
  49  *   }
  50  *
  51  *   Provider p = secmod.getModule(ModuleType.KEYSTORE).getProvider();
  52  *   KeyStore ks = KeyStore.getInstance("PKCS11", p);
  53  *   ks.load(null, password);
  54  * </pre>
  55  *
  56  * @since   1.6
  57  * @author  Andreas Sterbenz
  58  */
  59 public final class Secmod {
  60 
  61     private final static boolean DEBUG = false;
  62 
  63     private final static Secmod INSTANCE;
  64 
  65     static {
  66         sun.security.pkcs11.wrapper.PKCS11.loadNative();
  67         INSTANCE = new Secmod();
  68     }


< prev index next >