1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/cmd/pk11util/scripts/lcert Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 +Load nsscapi.dll 1.5 +C_Initialize NULL 1.6 +C_GetSlotList false NULL slotCount 1.7 +NewArray slotList CK_ULONG slotCount 1.8 +C_GetSlotList false slotList slotCount 1.9 +#change the following to the appropriate slot id 1.10 +set slotID 1 1.11 +#set slotID slotList[0] 1.12 +C_GetSlotInfo slotID slotInfo 1.13 +C_GetTokenInfo slotID tokenInfo 1.14 +C_OpenSession slotID CKF_SERIAL_SESSION session 1.15 +# 1.16 +#uncomment the following line and include the correct password 1.17 +#C_Login session CKU_USER 0000 4 1.18 +# 1.19 +# build the search template 1.20 +# 1.21 +NewTemplate search CKA_CLASS 1.22 +SetTemplate search 0 CKO_CERTIFICATE 1.23 +NewArray certID CK_ULONG 10 1.24 +C_FindObjectsInit session search 1 1.25 +C_FindObjects session certID sizeA(certID) count 1.26 +C_FindObjectsFinal session 1.27 +# 1.28 +# now read the cert out 1.29 +# 1.30 +#NewTemplate derCert CKA_VALUE 1.31 +#NewTemplate certName CKA_LABEL,CKA_VALUE 1.32 +#C_GetAttributeValue session certID[0] certName sizeA(certName) 1.33 +#BuildTemplate certName 1.34 +#C_GetAttributeValue session certID[0] certName sizeA(certName) 1.35 +#print certName[0] 1.36 +Set countm1 count 1.37 +Decrement countm1 1 1.38 +LoopRun pLabel1 i 0 countm1 1