Kai Engert wrote:
You probably have not linked your plugin with the appropriate NSS library files.In meantime was able to develop a Plugin, which can basicly access pkcs11 functions.
My Problem was (possibly is still?) that C_Initialize always failds.
But may I must not call C_Initialize, because mozilla initialized the pkcs11 Module already for me?
C_GetFunctionList and also C_GetInfo works well and results:
info.cryptokiVersion = 2.11
info.libraryVersion = 3.6
manufacturerID = Mozilla.org
libraryDescription = PSM Internal Crypto Services
This means its already initialized?
I think the correct approach would be to use XPCOM. You can access XPCOM interfaces from within a plugin. I was told you would have to access the component manager and there should be examples in mozilla/modules/plugins/.
Hmm XPCOM? should be the right way, does Netscape 4.x also supports XPCOM?
Maybe you could describe what you are planning to do and why you think using a plugin would be best?I whould prefer an signed applet, but I have to write it as an Plugin. so, there is no choise for me. :(
my next major Problem is:
====
CK_RV rv;
CK_FUNCTION_LIST_PTR pFunctionList;
CK_C_GetSlotList pC_GetSoltList;
CK_SLOT_ID_PTR pSlotList;
CK_ULONG l=10;
char* s = malloc(100*sizeof(char));
rv = C_GetFunctionList(&pFunctionList);
if(rv != CKR_OK) {
sprintf(s,"GetFunctionList fehlgeschlagen %ld", rv );
return s;
}
pC_GetSoltList = pFunctionList->C_GetSlotList;
pSlotList = (CK_SLOT_ID_PTR) malloc(l*sizeof(CK_SLOT_ID));
rv = (*pC_GetSoltList)(CK_FALSE, pSlotList, &l);
if(rv != CKR_OK){
free(pSlotList);
sprintf(s,"GetSlotList fehlgeschlagen %ld", rv );
return s;
} else {
sprintf(s,"Anz. Slots: %ld", l );
}
free(pSlotList);
return s;
====
C_GetSoltList set l to 0, but the Mozilla Certificate-Manager tells that there are some certificates (in "Yours" and "Others"):(
Any hints?
Bye,
Holger
--
lortas at web de
