SmartFTP FTP Library
Example

C++

// Import SmartFTP FTP Library
#import "libid:7A3A786C-EB8C-43b3-BC10-8D09ACF5D195" version("1.5")

sfFTPLib::IKeyManagerPtr pManager;
if(SUCCEEDED(pManager.CreateInstance(__uuidof(sfFTPLib::KeyManager))))
{
  // Load key from file
  sfFTPLib::IKeyPtr pKey = pManager->LoadFile(_bstr_t(L"Identity"), _bstr_t(L"Password"));
  // Save public key to file
  pManager->SaveFile(sfFTPLib::ftpKeyFileFormatSSH, pKey, sfFTPLib::ftpKeyTypePublicKey, _T("mykey.pub"), _bstr_t(L""));
}

 

To generate a key see the example in the IRSAKey documentation.

Copyright (c) by SmartSoft Ltd. All rights reserved.