/// <summary> /// Creates a new Credentials /// </summary> public CimCredential(ImpersonatedAuthenticationMechanism authenticationMechanism) { string strAuthenticationMechanism = null; if (authenticationMechanism == ImpersonatedAuthenticationMechanism.None) { strAuthenticationMechanism = MI_AuthType.NONE; } else if (authenticationMechanism == ImpersonatedAuthenticationMechanism.Negotiate) { strAuthenticationMechanism = MI_AuthType.NEGO_NO_CREDS; } else if (authenticationMechanism == ImpersonatedAuthenticationMechanism.Kerberos) { strAuthenticationMechanism = MI_AuthType.KERBEROS; } else if (authenticationMechanism == ImpersonatedAuthenticationMechanism.NtlmDomain) { strAuthenticationMechanism = MI_AuthType.NTLM; } else { throw new ArgumentOutOfRangeException("authenticationMechanism"); } NativeCimCredential.CreateCimCredential(strAuthenticationMechanism, out credential); }
public CimCredential(ImpersonatedAuthenticationMechanism authenticationMechanism) { string authTypeNTLM = null; if (authenticationMechanism != ImpersonatedAuthenticationMechanism.None) { if (authenticationMechanism != ImpersonatedAuthenticationMechanism.Negotiate) { if (authenticationMechanism != ImpersonatedAuthenticationMechanism.Kerberos) { if (authenticationMechanism != ImpersonatedAuthenticationMechanism.NtlmDomain) { throw new ArgumentOutOfRangeException("authenticationMechanism"); } else { authTypeNTLM = AuthType.AuthTypeNTLM; } } else { authTypeNTLM = AuthType.AuthTypeKerberos; } } else { authTypeNTLM = AuthType.AuthTypeNegoNoCredentials; } } else { authTypeNTLM = AuthType.AuthTypeNone; } NativeCimCredential.CreateCimCredential(authTypeNTLM, out this.credential); }
internal static void CreateCimCredential(ImpersonatedAuthenticationMechanism authenticationMechanism, out NativeCimCredential credential) { // TODO: Implement credential = new NativeCimCredential(true, new SecureString()); }
public RDPCredential(ImpersonatedAuthenticationMechanism impAuth) : base(impAuth) { }