Esempio n. 1
0
        /// <summary>
        /// Set the digest type
        /// </summary>
        /// <param name="digestType"></param>
        /// <returns></returns>
        public SSHClient SetDigestType(SSHPrivateKeyAuthenticator.DigestType digestType)
        {
            if (CurrentAuthenticator is SSHPrivateKeyAuthenticator auth)
            {
                auth.SetDigestType(digestType);
            }

            return(this);
        }
Esempio n. 2
0
 /// <summary>
 /// Construct a client with a key you already loaded
 /// </summary>
 /// <param name="httpClient"></param>
 /// <param name="endpoint"></param>
 /// <param name="username"></param>
 /// <param name="privateKey"></param>
 /// <param name="digestType"></param>
 public SSHClient(HttpClient httpClient, String endpoint, String username, RSA privateKey, SSHPrivateKeyAuthenticator.DigestType digestType = SSHPrivateKeyAuthenticator.DigestType.SSH_RSA_SHA256) :
     base(httpClient, endpoint, new SSHPrivateKeyAuthenticator(username, privateKey, digestType))
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Construct a client with a certificate you already loaded
 /// </summary>
 /// <param name="endpoint"></param>
 /// <param name="username"></param>
 /// <param name="x509"></param>
 /// <param name="digestType"></param>
 public SSHClient(String endpoint, String username, X509Certificate2 x509, SSHPrivateKeyAuthenticator.DigestType digestType = SSHPrivateKeyAuthenticator.DigestType.SSH_RSA_SHA256) :
     base(endpoint, new SSHPrivateKeyAuthenticator(username, x509, digestType))
 {
 }
Esempio n. 4
0
 /// <summary>
 /// Construct a client with a path to a local private key file
 /// </summary>
 /// <param name="endpoint"></param>
 /// <param name="username"></param>
 /// <param name="X509Path"></param>
 /// <param name="password"></param>
 /// <param name="digestType"></param>
 public SSHClient(String endpoint, String username, String X509Path, String password = null, SSHPrivateKeyAuthenticator.KeyType keyType = SSHPrivateKeyAuthenticator.KeyType.PKCS8, SSHPrivateKeyAuthenticator.DigestType digestType = SSHPrivateKeyAuthenticator.DigestType.SSH_RSA_SHA256) :
     base(endpoint, new SSHPrivateKeyAuthenticator(username, X509Path, password, keyType, digestType))
 {
 }