Hello, i need to access a smartcard for signing documents with the private key 
stored inside it.
The idea is to create a c++ component that will be used with a pnacl module 
inside chrome's browser.

So i decided to use NSS, but i'm confused about what steps i need to do for 
load the smartcard, access the private key, sign and verify the document.

I read almost all the existing documentation and didn find any sample to do 
that.

So, here's my code:

int main(int argc, char** argv) {
        SECMODModule *module;
        SECStatus rv;
        static char moduleName[] = "library=libwdpkcs_icp.so 
name=Token-libwdpkcs_icp";
                
        module = SECMOD_LoadUserModule(moduleName, NULL, PR_TRUE);

        if(!module) {
                fprintf(stderr, "fail to load module");
                exit(1);
        }

        PK11SlotInfo* slot = PK11_GetInternalSlot(); //didnt work. Returns 
nothing (0x0);

        /*
        *  Ok, i load the module. What's next? I need to create a DB or i can 
access the token directly? If so, how can i do this?
        *  Probably the next step is to get the slot info. But how?
        */

        SECMOD_DestroyModule(module);
}

Can anyone give me some help? 
Thanks in advance.
ps: sorry for my english
-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to