login about faq

I need to use ftp2 in classic asp to connect to an ftp site that requires the use of a private key file (xxx.ppx). Has anyone done this?

Thanks.

asked Apr 17 '14 at 14:42

dscapecod's gravatar image

dscapecod
111


This is Perl but same concept.

Load up the key into CkSshKey, openSshPrivateKey, and AuthenticatePK. There is another method if both the key and password is required.

if (length($f->privatekey) && $f->privatekey ne "NULL")

{
   $key = new chilkat::CkSshKey();
   $privKey = $key->loadText($pkey);
   if ($privKey eq "" ) {
              $message="Load Private Key Error \n" . $ftp->lastErrorText();
              $cm->Comment($message,1);
      return $message;
}
    $success = $key->FromOpenSshPrivateKey($privKey);
    if ($success != 1) {
              $message="Private Key Error \n" . $ftp->lastErrorText();
              $cm->Comment($message,1);
      return $message;
    }
    $success = $ftp->AuthenticatePk($f->myftpuser,$key);
    if ($success != 1) {
              $message="Key authenticate Error \n" . $ftp->lastErrorText();
              $cm->Comment($message,1);
      return $message;
    }
link

answered Apr 18 '14 at 11:49

cdlvj130's gravatar image

cdlvj130
9691017

also ftp does not have public and private keys, only sftp.

link

answered Apr 18 '14 at 11:51

cdlvj130's gravatar image

cdlvj130
9691017

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×90

Asked: Apr 17 '14 at 14:42

Seen: 1,088 times

Last updated: Apr 18 '14 at 11:51

powered by OSQA