def getTokenInfo(self, slot):
tokeninfo = PyKCS11.LowLevel.CK_TOKEN_INFO()<EOL>rv = self.lib.C_GetTokenInfo(slot, tokeninfo)<EOL>if rv != CKR_OK:<EOL><INDENT>raise PyKCS11Error(rv)<EOL><DEDENT>t = CK_TOKEN_INFO()<EOL>t.label = tokeninfo.GetLabel()<EOL>t.manufacturerID = tokeninfo.GetManufacturerID()<EOL>t.model = tokeninfo.GetModel()<EOL>t.serialNumber = tokeninfo.GetSerialNumber()<EOL>t.flags = tokeninfo.flags<EOL>t.ulMaxSessionCount = tokeninfo.ulMaxSessionCount<EOL>if t.ulMaxSessionCount == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulMaxSessionCount = -<NUM_LIT:1><EOL><DEDENT>t.ulSessionCount = tokeninfo.ulSessionCount<EOL>if t.ulSessionCount == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulSessionCount = -<NUM_LIT:1><EOL><DEDENT>t.ulMaxRwSessionCount = tokeninfo.ulMaxRwSessionCount<EOL>if t.ulMaxRwSessionCount == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulMaxRwSessionCount = -<NUM_LIT:1><EOL><DEDENT>t.ulRwSessionCount = tokeninfo.ulRwSessionCount<EOL>if t.ulRwSessionCount == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulRwSessionCount = -<NUM_LIT:1><EOL><DEDENT>t.ulMaxPinLen = tokeninfo.ulMaxPinLen<EOL>t.ulMinPinLen = tokeninfo.ulMinPinLen<EOL>t.ulTotalPublicMemory = tokeninfo.ulTotalPublicMemory<EOL>if t.ulTotalPublicMemory == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulTotalPublicMemory = -<NUM_LIT:1><EOL><DEDENT>t.ulFreePublicMemory = tokeninfo.ulFreePublicMemory<EOL>if t.ulFreePublicMemory == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulFreePublicMemory = -<NUM_LIT:1><EOL><DEDENT>t.ulTotalPrivateMemory = tokeninfo.ulTotalPrivateMemory<EOL>if t.ulTotalPrivateMemory == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulTotalPrivateMemory = -<NUM_LIT:1><EOL><DEDENT>t.ulFreePrivateMemory = tokeninfo.ulFreePrivateMemory<EOL>if t.ulFreePrivateMemory == CK_UNAVAILABLE_INFORMATION:<EOL><INDENT>t.ulFreePrivateMemory = -<NUM_LIT:1><EOL><DEDENT>t.hardwareVersion = (tokeninfo.hardwareVersion.major,<EOL>tokeninfo.hardwareVersion.minor)<EOL>t.firmwareVersion = (tokeninfo.firmwareVersion.major,<EOL>tokeninfo.firmwareVersion.minor)<EOL>t.utcTime = tokeninfo.GetUtcTime().replace('<STR_LIT>', '<STR_LIT:U+0020>')<EOL>return t<EOL>
C_GetTokenInfo

:param slot: slot number returned by :func:`getSlotList`
:type slot: integer
:return: a :class:`CK_TOKEN_INFO` object