Discuss this help topic in SecureBlackbox Forum


TElSSHKey     See also     

Filter: C#  VB.NET  Pascal  C++  PHP  Java  

This method loads the private key from file or buffer.


    int LoadPrivateKey(string PrivateKeyFile, string Passphrase);
    int LoadPrivateKey(byte[] Buffer, int Size, string Passphrase);

    Function LoadPrivateKey(ByVal PrivateKeyFile As String, ByVal Passphrase As String) As Integer
    Function LoadPrivateKey(ByVal Buffer As Byte(), ByVal Size As Integer, ByVal Passphrase As String) As Integer

    function LoadPrivateKey(const PrivateKeyFile : string; const Passphrase : string = '') : integer;
    function LoadPrivateKey(Buffer : pointer; Size : integer; const Passphrase : string = '') : integer;

    int32_t LoadPrivateKey(const std::string &PrivateKeyFile, const std::string &Passphrase);
    int32_t LoadPrivateKey(void * Buffer, int32_t Size, const std::string &Passphrase);

    integer LoadPrivateKey(string $PrivateKeyFile, string $Passphrase)
    integer LoadPrivateKey(TSBPointer|array of byte|string|NULL $Buffer, integer $Size, string $Passphrase)

    int loadPrivateKey(byte[] Buffer, int Size, String Passphrase);
    int loadPrivateKey(String PrivateKeyFile, String Passphrase);


  • PrivateKeyFile - file which contains private key
  • Passphrase - password of the file with private key
  • Buffer - buffer which contains private key
  • Size - size of the buffer from which the data is loaded

Return value

    Returns 0 on success, and error code otherwise.

Error codes


    Use this method to load RSA/DSA private key from file or buffer.
    If the key is stored in Putty format (the file contains both public and private keys; only the private key is protected), and SB_ERROR_SSH_KEYS_INVALID_PASSPHRASE is returned, the public part of the key will be loaded anyway.

See also:     LoadPublicKey     SavePrivateKey     SavePublicKey    

Discuss this help topic in SecureBlackbox Forum