Exemple #1
0
 private string EncryptCredentials(string username, string password, string administrativePassword, X509Certificate2 certificate)
 {
     if (this.CryptoProvider == null)
         this.CryptoProvider = new ClientConsoleCryptoProvider();
     
     var resolvedUsername = this.ResolveUsername(username);
     return 
         this.CryptoProvider.EncryptCredential(
             certificate, resolvedUsername.Key, resolvedUsername.Value, password, administrativePassword);
 }
Exemple #2
0
 /// <summary>
 /// This contains the target address and encrypted credentials.
 /// </summary>
 /// <param name="address">The target IP Address or host name.</param>
 /// <param name="username">The target admin user name.</param>
 /// <param name="password">The target admin password.</param>
 /// <param name="certificate">The certificate that contains the public key to encrypt target credentials.</param>
 /// <param name="cryptoProvider">Only for unit tests purposes. Do not use it production code (pass always null on it).</param>
 public TargetParameters(
     string address, 
     string username, 
     string password,
     string administrativePassword,
     X509Certificate2 certificate, 
     ClientConsoleCryptoProvider cryptoProvider = null)
 {
     this.Address = address;
     this.CryptoProvider = cryptoProvider;
     this.EncryptedCredentials = this.EncryptCredentials(username, password, administrativePassword, certificate);
 }
Exemple #3
0
 /// <summary>
 /// This contains the target address and encrypted credentials.
 /// </summary>
 /// <param name="address">The target IP Address or host name.</param>
 /// <param name="username">The target admin user name.</param>
 /// <param name="password">The target admin password.</param>
 /// <param name="certificate">The certificate that contains the public key to encrypt target credentials.</param>
 /// <param name="cryptoProvider">Only for unit tests purposes. Do not use it production code (pass always null on it).</param>
 public TargetParameters(
     string address,
     string username,
     string password,
     string administrativePassword,
     X509Certificate2 certificate,
     ClientConsoleCryptoProvider cryptoProvider = null)
 {
     this.Address              = address;
     this.CryptoProvider       = cryptoProvider;
     this.EncryptedCredentials = this.EncryptCredentials(username, password, administrativePassword, certificate);
 }
Exemple #4
0
        private string EncryptCredentials(string username, string password, string administrativePassword, X509Certificate2 certificate)
        {
            if (this.CryptoProvider == null)
            {
                this.CryptoProvider = new ClientConsoleCryptoProvider();
            }

            var resolvedUsername = this.ResolveUsername(username);

            return
                (this.CryptoProvider.EncryptCredential(
                     certificate, resolvedUsername.Key, resolvedUsername.Value, password, administrativePassword));
        }