Azure.Identity.WindowsNativeMethods
namespace Azure.Identity
{
internal static class WindowsNativeMethods
{
public enum CRED_PERSIST : uint
{
CRED_PERSIST_SESSION = 1,
CRED_PERSIST_LOCAL_MACHINE,
CRED_PERSIST_ENTERPRISE
}
public enum CRED_TYPE
{
GENERIC = 1,
DOMAIN_PASSWORD,
DOMAIN_CERTIFICATE,
DOMAIN_VISIBLE_PASSWORD,
MAXIMUM
}
public struct CredentialData
{
public uint Flags;
public CRED_TYPE Type;
public string TargetName;
public string Comment;
public FILETIME LastWritten;
public uint CredentialBlobSize;
public IntPtr CredentialBlob;
public CRED_PERSIST Persist;
public uint AttributeCount;
public IntPtr Attributes;
public string TargetAlias;
public string UserName;
}
public const int ERROR_NOT_FOUND = 1168;
public const uint FORMAT_MESSAGE_ALLOCATE_BUFFER = 256;
public const uint FORMAT_MESSAGE_IGNORE_INSERTS = 512;
public const uint FORMAT_MESSAGE_FROM_SYSTEM = 4096;
public static IntPtr CredRead(string target, CRED_TYPE type);
public static void CredWrite(IntPtr userCredential);
public static void CredDelete(string target, CRED_TYPE type);
public static void CredFree(IntPtr userCredential);
}
}