Discuss this help topic in SecureBlackbox Forum

TElSSHKey.SavePrivateKey

TElSSHKey     See also     


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


This method saves the private key to file or buffer.

Declaration

[C#]
    int SavePrivateKey(ref byte[] Buffer, ref int Size, string Passphrase);
    int SavePrivateKey(string PrivateKeyFile, string Passphrase);

[VB.NET]
    Function SavePrivateKey(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal Passphrase As String) As Integer
    Function SavePrivateKey(ByVal PrivateKeyFile As String, ByVal Passphrase As String) As Integer

[Pascal]
    function SavePrivateKey(const PrivateKeyFile : string; const Passphrase : string = '') : integer;
    function SavePrivateKey(Buffer : pointer; var Size : integer; const Passphrase : string = '') : integer;

[C++]
    int32_t SavePrivateKey(void * Buffer, int32_t &Size, const std::string &Passphrase);
    int32_t SavePrivateKey(const std::string &PrivateKeyFile, const std::string &Passphrase);

[PHP]
    integer SavePrivateKey(TSBPointer|array of byte|string|NULL $Buffer, integer &$Size, string $Passphrase)
    integer SavePrivateKey(string $PrivateKeyFile, string $Passphrase)

[Java]
    int savePrivateKey(byte[] Buffer, TSBInteger Size, String Passphrase);
    int savePrivateKey(String PrivateKeyFile, String Passphrase);

Parameters

  • PrivateKeyFile - file to which private key is saved
  • Passphrase - password of the file with private key
  • Buffer - the buffer to which the key is saved.
  • Size - the size of the buffer to which the data is saved.When the method returns, Size parameter contains the size of the data that were saved, or, if the buffer was too small,the size of the buffer enough to hold the data.

Return value

    0 - on success.
    Error code otherwise.

Description

    Use this method to save private key to file or buffer.

See also:     LoadPrivateKey     LoadPublicKey     SavePublicKey    

Discuss this help topic in SecureBlackbox Forum