michael@0: This is a very trivial program that loads and excercises a PKCS#11 michael@0: module, trying basic operations. I used it as a basic check that michael@0: my data-only modules for NSS worked, and I'm including it here as michael@0: a first sample test program. michael@0: michael@0: michael@0: This program uses GNU autoconf: run ./configure --help for info. michael@0: In addition to the standard options, the configure script accepts michael@0: the following: michael@0: michael@0: --with-nspr[=path] specify location of NSPR michael@0: --with-nss-dist[=path] specify path to NSS dist directory michael@0: --with-nss-hdrs[=path] or, specify path to installed NSS headers michael@0: --with-rsa-hdrs[=path] if not using NSS, specify path to RSA headers michael@0: --disable-debug default is enabled michael@0: michael@0: This program uses NSPR; you may specify the path to your NSPR michael@0: installation by using the "--with-nspr" option. The specified michael@0: directory should be the one containing "include" and "lib." michael@0: If this option is not given, the default is the usual prefix michael@0: directories; see ./configure --help for more info. michael@0: michael@0: This program requires either the pkcs11*.h files from RSA, or michael@0: the NSS equivalents. To specify their location, you must michael@0: specify one of --with-nss-dist, --with-nss-hdrs, or --with-rsa-hdrs. michael@0: michael@0: If you have an NSS build tree, specify --with-nss-dist and provide michael@0: the path to the mozilla/dist/*.OBJ directory. (If you got this michael@0: package by checking it out from mozilla, it should be about six michael@0: directories up, once you've built NSS.) michael@0: michael@0: Alternatively, if you have an NSS installation (including "private" michael@0: files, e.g. "ck.h") you may point directly to the directory containing michael@0: the headers with --with-nss-hdrs. michael@0: michael@0: If you would rather use the RSA-provided header files, or your own michael@0: versions of them, specify their location with --with-rsa-hdrs. michael@0: michael@0: The flag --disable-debug doesn't really do much here other than michael@0: exclude the CVS_ID info from the binary. michael@0: michael@0: michael@0: To run the program, specify the name of the .so (or your platform's michael@0: equivalent) containing the module to be tested, e.g.: michael@0: michael@0: ./trivial ../../../../../../dist/*.OBJ/lib/libnssckbi.so michael@0: michael@0: michael@0: If you're using NSS, and using our experimental "installer's michael@0: arguments" fields in CK_C_INITIALIZE_ARGS, you can specify an michael@0: "installer argument" with the -i flag: michael@0: michael@0: ./trivial -i ~/.netscape/certs.db [...]/libnssckdb.so michael@0: michael@0: michael@0: Share and enjoy.