SmartFTP FTP Library
IKeyManager Interface

The key manager can load and save keys from and to files.

IKeyManager
IDL
interface IKeyManager : IDispatch;

C++

ATL::CComPtr<sfFTPLib::IKeyManager> keyManager;
ATLENSURE_SUCCEEDED(keyManager.CoCreateInstance(__uuidof(sfFTPLib::KeyManager)))));
// Load key from file
ATL::CComPtr<sfFTPLib::IKey> key;
ATLENSURE_SUCCEEDED(keyManager->LoadFile(ATL::CComBSTR(L"Identity"), ATL::CComBSTR(L"Password"), &key));

// Save public key to file
ATLENSURE_SUCCEEDED(keyManager->SaveFile(sfFTPLib::ftpKeyFileFormatSSH, key, sfFTPLib::ftpKeyTypePublicKey, ATL::CComBSTR(L"mykey.pub"), ATL::CComBSTR(L"")));

 

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

IKeyManager Methods 
Description 
Loads a key from a file. 
Loads a key from the current user's certificate store ("My"). 
Saves the key to a file. 
What do you think about this topic? Send feedback!
Copyright (c) by SmartSoft Ltd. All rights reserved.