Topic "issue with provided public key"

Author Message
DirtyHowi
[View user's profile]

Joined: 2013-11-08
Posts: 1
Location: planet earth
I am trying to interface with a partner FTP site using SFTP, I've gotten the winscp package for .net.

code looks like

Code:

        protected void UploadViaWINSCP()
        {
            var sessionOptions = new SessionOptions
            {
                Protocol = Protocol.Sftp,
                HostName = ConfigurationManager.AppSettings["Host"],
                UserName = ConfigurationManager.AppSettings["username"],
                Password = ConfigurationManager.AppSettings["password"],
                SshHostKeyFingerprint = "ssh-rsa 1024 xx:xx:xx:xx etc",
                PortNumber = 22
            };
            var localfilename = @"~/DataStore/" + ViewState["FileName"];
            var remotefilename = Path.GetFileName(localfilename);
            using (var session = new Session())
            {
                session.DisableVersionCheck = true;
                session.Open(sessionOptions);  //gets here and crashes
                TransferOptions transfer = new TransferOptions();
                transfer.TransferMode = TransferMode.Binary;
                TransferOperationResult transferrResult;
                transferrResult = session.PutFiles(localfilename, remotefilename, false, transfer);
                transferrResult.Check();
            }
        }


see comment line above...it gets to the session.open(sessionoptions) and kicks back with server said public key, which i have in a .pub file (both server and other). How do i use the public key file provided by the trading partner to upload a file to them, basically on demand, this is part of a larger asp.net project, 4.5 framework.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please post the actual error message.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License