EldoS
Navigation
Web site
Support
Table Of Contents

Filter: C#  VB.NET  Pascal  ActiveX  DLL 


TElSSHKey.LoadPrivateKey

TElSSHKey     See also    


 

This method loads the private key from file or buffer.

 
 

Declaration

[C#]
    int LoadPrivateKey([in] string PrivateKeyFile, [in] string Passphrase /* = "" */);
    int LoadPrivateKey(byte[] Buffer, int Size, [in] string Passphrase /* = "" */);

[VB.NET]
     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

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

[VB6]
    Sub LoadPrivateKey(PrivateKeyFile As String, PassPhrase As String)
    Sub LoadPrivateKeyFromBuffer(Buffer, PassPhrase As String)

[ActiveX]
    HRESULT _stdcall LoadPrivateKey([in] BSTR PrivateKeyFile, [in] BSTR PassPhrase, [out, retval] long * Ret);
    HRESULT _stdcall LoadPrivateKeyFromBuffer([in] VARIANT Buffer, [in] BSTR PassPhrase, [out, retval] long * Ret );

[DLL]
    not implemented;
 
 

Parameters

  • 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

    0 - on success.
    Error code otherwise.

 

Key Error Codes

Definition Value Description
SB_ERROR_SSH_KEYS_INVALID_PUBLIC_KEY 3329 (0x0D01) public key is invalid
SB_ERROR_SSH_KEYS_INVALID_PRIVATE_KEY 3330 (0x0D02) private key is invalid
SB_ERROR_SSH_KEYS_FILE_READ_ERROR 3331 (0x0D03) error of reading from file
SB_ERROR_SSH_KEYS_FILE_WRITE_ERROR 3332 (0x0D04) error of writing to file
SB_ERROR_SSH_KEYS_UNSUPPORTED_ALGORITHM 3333 (0x0D05) algorithm is unsupported
SB_ERROR_SSH_KEYS_INTERNAL_ERROR 3334 (0x0D06) internal error
SB_ERROR_SSH_KEYS_BUFFER_TOO_SMALL 3335 (0x0D07) buffer is too small
SB_ERROR_SSH_KEYS_NO_PRIVATE_KEY 3336 (0x0D08) there is no private key
SB_ERROR_SSH_KEYS_INVALID_PASSPHRASE 3337 (0x0D09) wrong password for private key
SB_ERROR_SSH_KEYS_UNSUPPORTED_PEM_ALGORITHM 3338 (0x0D0A) PEM algorithm is unsupported
Declared in
[.NET] [Pascal]
Namespace: SBSSHKeyStorage
Assembly: SecureBlackbox.SSHCommon
Unit: SBSSHKeyStorage

 
 

Description

    Use this method to load RSA/DSA private key from file or buffer.

 
 

See also:     LoadPublicKey     SavePrivateKey     SavePublicKey    

 
Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2012, EldoS Corporation