Beispiel #1
0
		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);
		}
Beispiel #2
0
        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);
        }
Beispiel #3
0
        /// <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);
        }
Beispiel #4
0
 internal static void CreateCimCredential(CertificateAuthenticationMechanism authenticationMechanism, string certificateThumbprint, out NativeCimCredential credential)
 {
     // TODO: Implement
     credential = new NativeCimCredential(true, new SecureString());
 }