Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Python µ÷ÓÃCAPICOM ¶ÁÈ¡ USB KEYÊý×ÖÖ¤Êé

import win32com.client
store = win32com.client.Dispatch('CAPICOM.Store')
# ´ò¿ªÖ¤Êé´æ´¢Çø
# 2 -> CAPICOM_CURRENT_USER_STORE
# 0 -> CAPICOM_STORE_OPEN_READ_ONLY
store.Open(2, "My", 0)
# ²éÕÒÓÐЧ֤Êé
# 12 -> CAPICOM_CERTIFICATE_FIND_KEY_USAGE
# 0x00000080 -> CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE
# 9 -> CAPICOM_CERTIFICATE_FIND_TIME_VALID
# 6,6 -> CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,CERT_KEY_SPEC_PROP_ID
stores = store.Certificates.Find(12,0x00000080).Find(9).Find(6,6)
stores = store.Certificates.Find(0,szThumbprint) # szThumbprint -> °´ËõÂÔͼ²éѯ
# 0 -> CAPICOM_CERTIFICATE_FIND_SHA1_HASH
# ÕÒµ½Ö¤Êé¼ÆÊý
stores.Count
# »ñÈ¡Ö¤ÊéÐÅÏ¢
for data in stores:
    data.GetInfo(0) # °ä·¢¸ø
    data.GetInfo(1) # °ä·¢Õß
    data.GetInfo(2) # Ö÷Ìâ(E) Email
    data.GetInfo(3) # ''
    data.GetInfo(4) # Ö÷ÒªÃû³Æ= RFC822 Name=
    data.GetInfo(5) # ''
    data.GetInfo(6) # Ö÷Ìâ(CN)
    data.GetInfo(7) # °ä·¢Õß
    data.Thumbprint # ËõÂÔͼ
»òÕß
stores.Item(idx).GetInfo(idx2) # idx 1-stores.Count
# idx2 0-7
# Ö¤ÊéÑ¡Ôñ
selCert = soters.Select()
selCert.GetInfo(0-7)
selCert.Thumbprint
# Êý¾ÝÇ©Ãû
SignedData = win32com.client.Dispatch('CAPICOM.SignedData')
Signer = win32com.client.Dispatch('CAPICOM.Signer')
TimeAttribute = win32com.client.Dispatch('CAPICOM.Attribute')
SignedData.Content = 'Test' # Ç©ÃûÄÚÈÝ
Signer.Certificate = ret.Item(1) # Ñ¡ÔñµÄÖ¤Êé
TimeAttribute.Name = 0 # 0 -> CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME
import datetime
TimeAttribute.Value = datetime.datetime('2010-04-22')
Signer.AuthenticatedAttributes.Add(TimeAttribute)
szSignature = SignedData.Sign(Signer, True, 0) # 0 -> CAPICOM_ENCODE_BASE64
# Ç©ÃûУÑé
SignedData.Content='Test';
SignedData.Verify(szSignature, true, 1); # 1 -> CAPICOM_VERIFY_SIGNATURE_AND_CERTIFIC


Ïà¹ØÎĵµ£º

python timeÄ£¿éÏê½â

 python µÄÄÚǶtimeÄ£°å·­Ò뼰˵Ã÷
 
Ò»¡¢¼ò½é
  timeÄ£¿éÌṩ¸÷ÖÖ²Ù×÷ʱ¼äµÄº¯Êý
  ˵Ã÷£ºÒ»°ãÓÐÁ½ÖÖ±íʾʱ¼äµÄ·½Ê½:
       µÚÒ»ÖÖÊÇʱ¼ä´ÁµÄ·½Ê½(Ïà¶ÔÓÚ1970.1.1 00:00:00ÒÔÃë¼ÆËãµÄÆ«ÒÆÁ¿),ʱ¼ä´ÁÊÇΩһµÄ
       µÚ¶þÖÖÒÔÊý× ......

¶¯Ì¬´ó±ÈÆ´Python¡¢LuaºÍRuby


ÀµÓºÆ(http://blog.csdn.net/lanphaday) Òë
ÒëÕß°´£ºPython¡¢luaºÍrubyÔÚC/C++ÊÇÈÕ½¥Ê½Î¢µÄÇé¿öÏ£¬ÔÚjava/.netµÄΧ¼ßÖÐŬÁ¦¿¹ÕùµÄÈý¸öµ±ºìСÉú¡£ÔÚTom GutschmidtµÄÖø×÷¡¶Game Programmng with Python, Lua and Ruby¡·Ò»ÊéÖУ¬½éÉÜÁËÈýÖÖÓïÑÔÔÚÓÎÏ·ÖеÄÓ¦Óã¬ÆäÖÐÓÈΪÁ˲»ÆðµÄÊÇÔÚÊéÖÐ×îºóÒ»ÕÂÖбȽÏÁËÈýÖֽű¾£¬×÷Õßà ......

RubyºÍPythonµÄÓï·¨±È½Ï


RubyºÍPythonµÄÓï·¨±È½Ï
 
 
 
ÆäʵRubyºÍPython·Ç³£½Ó½ü£¬±È´ó¶àÊý±ðµÄÓïÑÔÒª½Ó½üµÄ¶à£¬ËùÒÔϲ»¶ÓÃɶ¾ÍÓÃɶ£¨´óʵ»°£¬ËäȻҲÊÇ·Ï»°£©¡£Óï·¨ÉϵIJî±ðËäÈ»ÓÐÄÇôһµã£¬´ó²¿·ÖÊÇsyntax sugar£¬ÎÒ¶·µ¨ÉÔ΢Áм¸¸ö£¨pythonÎÒÒ²ÍüµÃ²î²»¶àÁË£¬²»¶ÔµÄ´ó¼Ò¾¡¹ÜÀ´±Þʬ°É£©£¬µ«ÊÇÖ÷Òª²îÒ컹ÊÇÉè¼Æ˼ÏëÉϵģºÁé»î ......

¼ò»¯Python½âÊÍ»·¾³µÄ°²×°

ÎÊÌâÃèÊö
ÔÚC++ºÍPython»ìºÏ±à³ÌÖУ¬ÔÚÈí¼þ·¢²¼µÄʱºòÐèÒª½«pythonµÄ½âÊÍÆ÷´ò°üµ½°²×°³ÌÐòÖУ¬ÎªÁËÌá¸ßÓû§ÌåÑ飬ÎÒÃÇÐèÒªÈÃÓû§¸Ð¾õ²»µ½pythonµÄ°²×°£¬Èç¹ûÓû§ÒѾ­°²×°ÓÐpythonµÄ»·¾³£¬ÎÒÃÇÒ²Òª±£Ö¤²»Ó°ÏìÏÖÓеÄϵͳ¡£
½â¾ö·½°¸
ÔÚPython2.5ÒÔºó£¬pythonÖ§³Ö´ÓzipÎļþÖжÁÈ¡python½Å±¾Îļþ£¬Ö§³Ö¶ÁÈ¡py£¬pyc£¬pyo£¬²»Ö ......

»°ËµPython£¨Ð´ÔÚÇ°ÃæµÄ»°£©

±¾ÏµÁÐÎÄÕ²»»á½éÉÜÖîÈç°²×°PythonÖ®ÀàµÄÎÊÌ⣬Ҳ²»Ïëд³É¹ØÓÚPythonµÄ½Ì¿ÆÊé¡£ÊÂʵÉ϶ÔÓÚ³ÌÐòÔ±£¬Python¸ù±¾²»ÐèÒªºñºñµÄÈëÃÅÊé¼®£¬ÊÖ±ßÒ»±¾PythonÎĵµ¼´¿É¡£ÒòΪÄã»á·¢ÏÖ£¬ÊÔ×ÅÖ´ÐÐÒ»¶ÎÄãÈÏΪ¿ÉÄܳɹ¦µÄ´úÂ룬Python»áÏñÆÚÍûµÄÄÇÑùÔËÐС£
ÎÄÕ½«»á½éÉÜÁ½Î»Ö÷È˹«£ºÐ¡²ËºÍС°×£¬Á½ÈËÊÇ´óÈýѧÉú£¬Ñ§Ï°¹ýCºÍJava¿Î³Ì¡£±¾Îļ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ