michael@0: Load nsscapi.dll michael@0: C_Initialize NULL michael@0: C_GetSlotList false NULL slotCount michael@0: NewArray slotList CK_ULONG slotCount michael@0: C_GetSlotList false slotList slotCount michael@0: #change the following to the appropriate slot id michael@0: set slotID 1 michael@0: #set slotID slotList[0] michael@0: C_GetSlotInfo slotID slotInfo michael@0: C_GetTokenInfo slotID tokenInfo michael@0: C_OpenSession slotID CKF_SERIAL_SESSION session michael@0: # michael@0: #uncomment the following line and include the correct password michael@0: #C_Login session CKU_USER 0000 4 michael@0: # michael@0: # build the search template michael@0: # michael@0: NewTemplate search CKA_CLASS michael@0: SetTemplate search 0 CKO_CERTIFICATE michael@0: NewArray certID CK_ULONG 10 michael@0: C_FindObjectsInit session search 1 michael@0: C_FindObjects session certID sizeA(certID) count michael@0: C_FindObjectsFinal session michael@0: # michael@0: # now read the cert out michael@0: # michael@0: #NewTemplate derCert CKA_VALUE michael@0: #NewTemplate certName CKA_LABEL,CKA_VALUE michael@0: #C_GetAttributeValue session certID[0] certName sizeA(certName) michael@0: #BuildTemplate certName michael@0: #C_GetAttributeValue session certID[0] certName sizeA(certName) michael@0: #print certName[0] michael@0: Set countm1 count michael@0: Decrement countm1 1 michael@0: LoopRun pLabel1 i 0 countm1 1