Vehicle-Anti-Theft-Face-Rec.../venv/Lib/site-packages/win32/Demos/security/lsastore.py

12 lines
457 B
Python
Raw Normal View History

2020-11-12 16:05:57 +00:00
import win32security
policy_handle = win32security.GetPolicyHandle('',win32security.POLICY_ALL_ACCESS)
privatedata='some sensitive data'
keyname='tmp'
win32security.LsaStorePrivateData(policy_handle,keyname,privatedata)
retrieveddata=win32security.LsaRetrievePrivateData(policy_handle,keyname)
assert retrieveddata==privatedata
## passing None deletes key
win32security.LsaStorePrivateData(policy_handle,keyname,None)
win32security.LsaClose(policy_handle)