security/nss/cmd/pk11util/scripts/lcert

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     1 Load nsscapi.dll
     2 C_Initialize NULL
     3 C_GetSlotList false NULL slotCount
     4 NewArray slotList CK_ULONG slotCount
     5 C_GetSlotList false slotList slotCount
     6 #change the following to the appropriate slot id
     7 set slotID 1
     8 #set slotID slotList[0]
     9 C_GetSlotInfo slotID slotInfo
    10 C_GetTokenInfo slotID tokenInfo
    11 C_OpenSession slotID CKF_SERIAL_SESSION session
    12 #
    13 #uncomment the following line and include the correct password
    14 #C_Login session CKU_USER 0000 4 
    15 #
    16 # build the search template
    17 #
    18 NewTemplate search CKA_CLASS
    19 SetTemplate search 0 CKO_CERTIFICATE
    20 NewArray certID CK_ULONG 10
    21 C_FindObjectsInit session search 1
    22 C_FindObjects session certID sizeA(certID) count
    23 C_FindObjectsFinal session
    24 #
    25 # now read the cert out
    26 #
    27 #NewTemplate derCert CKA_VALUE
    28 #NewTemplate certName CKA_LABEL,CKA_VALUE
    29 #C_GetAttributeValue session certID[0] certName sizeA(certName)
    30 #BuildTemplate certName
    31 #C_GetAttributeValue session certID[0] certName sizeA(certName)
    32 #print certName[0]
    33 Set countm1 count
    34 Decrement countm1 1
    35 LoopRun pLabel1 i 0 countm1 1

mercurial