security/nss/cmd/pk11util/scripts/pcert

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/cmd/pk11util/scripts/pcert	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +Load aolkeypk11.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 CK_SESSION_SERIAL 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 1
    1.24 +C_FindObjectsInit session search 1
    1.25 +C_FindObjects session certID 1 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 +C_GetAttributeValue session certID derCert 1
    1.32 +BuildTemplate derCert
    1.33 +C_GetAttributeValue session certID derCert 1

mercurial