win32cred

Interface to credentials management functions.

Functions

CredDelete(TargetName, Type[, Flags]) Remove the given target name from the stored credentials.
CredEnumerate([Filter, Flags]) Remove the given target name from the stored credentials.
CredRead(TargetName, Type[, Flags]) Retrieves a stored credential.
CredWrite(Credential[, Flags]) Creates or updates a stored credential.


win32ctypes.pywin32.win32cred.CredDelete(TargetName, Type, Flags=0)[source]

Remove the given target name from the stored credentials.

Parameters:
  • TargetName (unicode) – The target name to fetch from the keyring.
  • Type (int) – One of the CRED_TYPE_* constants.
  • Flags (int) – Reserved, always use 0.
win32ctypes.pywin32.win32cred.CredEnumerate(Filter=None, Flags=0)[source]

Remove the given target name from the stored credentials.

Parameters:
  • Filter (unicode) – Matches credentials’ target names by prefix, can be None.
  • Flags (int) – When set to CRED_ENUMERATE_ALL_CREDENTIALS enumerates all of the credentials in the user’s credential set but in that case the Filter parameter should be NULL, an error is raised otherwise
Returns:

credentials (list) – Returns a sequence of CREDENTIAL dictionaries.

win32ctypes.pywin32.win32cred.CredRead(TargetName, Type, Flags=0)[source]

Retrieves a stored credential.

Parameters:
  • TargetName (unicode) – The target name to fetch from the keyring.
  • Type (int) – One of the CRED_TYPE_* constants.
  • Flags (int) – Reserved, always use 0.
Returns:

credentials (dict) – None if the target name was not found or A dictionary corresponding to the PyWin32 PyCREDENTIAL structure.

win32ctypes.pywin32.win32cred.CredWrite(Credential, Flags=0)[source]

Creates or updates a stored credential.

Parameters:
  • Credential (dict) – A dictionary corresponding to the PyWin32 PyCREDENTIAL structure.
  • Flags (int) – Always pass CRED_PRESERVE_CREDENTIAL_BLOB (i.e. 0).