public CimCredential(CertificateAuthenticationMechanism authenticationMechanism, string certificateThumbprint) { string authTypeIssuerCert = null; if (authenticationMechanism != CertificateAuthenticationMechanism.Default) { if (authenticationMechanism != CertificateAuthenticationMechanism.ClientCertificate) { if (authenticationMechanism != CertificateAuthenticationMechanism.IssuerCertificate) { throw new ArgumentOutOfRangeException("authenticationMechanism"); } else { authTypeIssuerCert = AuthType.AuthTypeIssuerCert; } } else { authTypeIssuerCert = AuthType.AuthTypeClientCerts; } } else { authTypeIssuerCert = AuthType.AuthTypeClientCerts; } NativeCimCredential.CreateCimCredential(authTypeIssuerCert, certificateThumbprint, out this.credential); }
/// <summary> /// Creates a new Credentials /// </summary> public CimCredential(CertificateAuthenticationMechanism authenticationMechanism, string certificateThumbprint) { string strAuthenticationMechanism = null; if (authenticationMechanism == CertificateAuthenticationMechanism.Default) { strAuthenticationMechanism = MI_AuthType.CLIENT_CERTS; } else if (authenticationMechanism == CertificateAuthenticationMechanism.ClientCertificate) { strAuthenticationMechanism = MI_AuthType.CLIENT_CERTS; } else if (authenticationMechanism == CertificateAuthenticationMechanism.IssuerCertificate) { strAuthenticationMechanism = MI_AuthType.ISSUER_CERT; } else { throw new ArgumentOutOfRangeException("authenticationMechanism"); } NativeCimCredential.CreateCimCredential(strAuthenticationMechanism, certificateThumbprint, out credential); }
internal static void CreateCimCredential(CertificateAuthenticationMechanism authenticationMechanism, string certificateThumbprint, out NativeCimCredential credential) { // TODO: Implement credential = new NativeCimCredential(true, new SecureString()); }