NET SFTP Library
GenerateSshKey Method






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class : GenerateSshKey Method
The output directory
The name for the key
The passphrase (use string.Empty for no passphrase)
The comment for the public key
RSA or DSA
DSA keys are 1024 bits, RSA keys can be 1024, 2048, or 4096 bits
IETF or OpenSSH
IETF, OpenSSH, or Putty
Generate a public/private key pair for SSH.
Syntax
'Declaration
 
Public Sub GenerateSshKey( _
   ByVal outputPath As System.String, _
   ByVal keyName As System.String, _
   ByVal passPhrase As System.String, _
   ByVal comment As System.String, _
   ByVal keyAlgorithm As SshKeyAlgorithm, _
   ByVal keySize As SshKeySize, _
   ByVal publicKeyType As SshPublicKeyType, _
   ByVal privateKeyType As SshPrivateKeyType _
) 
'Usage
 
Dim instance As SFTP
Dim outputPath As System.String
Dim keyName As System.String
Dim passPhrase As System.String
Dim comment As System.String
Dim keyAlgorithm As SshKeyAlgorithm
Dim keySize As SshKeySize
Dim publicKeyType As SshPublicKeyType
Dim privateKeyType As SshPrivateKeyType
 
instance.GenerateSshKey(outputPath, keyName, passPhrase, comment, keyAlgorithm, keySize, publicKeyType, privateKeyType)
public void GenerateSshKey( 
   System.string outputPath,
   System.string keyName,
   System.string passPhrase,
   System.string comment,
   SshKeyAlgorithm keyAlgorithm,
   SshKeySize keySize,
   SshPublicKeyType publicKeyType,
   SshPrivateKeyType privateKeyType
)
public procedure GenerateSshKey( 
    outputPath: System.String;
    keyName: System.String;
    passPhrase: System.String;
    comment: System.String;
    keyAlgorithm: SshKeyAlgorithm;
    keySize: SshKeySize;
    publicKeyType: SshPublicKeyType;
    privateKeyType: SshPrivateKeyType
); 
public function GenerateSshKey( 
   outputPath : System.String,
   keyName : System.String,
   passPhrase : System.String,
   comment : System.String,
   keyAlgorithm : SshKeyAlgorithm,
   keySize : SshKeySize,
   publicKeyType : SshPublicKeyType,
   privateKeyType : SshPrivateKeyType
);
public: void GenerateSshKey( 
   System.string* outputPath,
   System.string* keyName,
   System.string* passPhrase,
   System.string* comment,
   SshKeyAlgorithm keyAlgorithm,
   SshKeySize keySize,
   SshPublicKeyType publicKeyType,
   SshPrivateKeyType privateKeyType
) 
public:
void GenerateSshKey( 
   System.String^ outputPath,
   System.String^ keyName,
   System.String^ passPhrase,
   System.String^ comment,
   SshKeyAlgorithm keyAlgorithm,
   SshKeySize keySize,
   SshPublicKeyType publicKeyType,
   SshPrivateKeyType privateKeyType
) 

Parameters

outputPath
The output directory
keyName
The name for the key
passPhrase
The passphrase (use string.Empty for no passphrase)
comment
The comment for the public key
keyAlgorithm
RSA or DSA
keySize
DSA keys are 1024 bits, RSA keys can be 1024, 2048, or 4096 bits
publicKeyType
IETF or OpenSSH
privateKeyType
IETF, OpenSSH, or Putty
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFTP Class
SFTP Members