Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
CURL.SetOptionSSHPublicKeyfile
Sets the file path for the public key file.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| CURL | 2.5 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl | |
| Value | The new public key file path. | "c:\mykey.pub" | |
| Encoding | The text encoding for text parameter. Default is UTF-8. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
"UTF8" | Optional |
Result
Returns "OK" on success.
Description
Sets the file path for the public key file.If not used, libcurl defaults to using ~/.ssh/id_dsa.pub.
Usually the public key is part of private key file, so you don't need an extra public key file.
For a SFTP transfer (= file transfer over SSH), you would tell the plugin your public and private keys, so the plugin can login.
See also SSH_PUBLIC_KEYFILE option in CURL manual.
Examples
Login via SSH with public key:
Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; "sftp://test.com:1222/test.fmp12" ) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionVerbose"; $curl; 1) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUpload"; $curl; 1) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionConnectionTimeout"; $curl; 10) ]
#
# specify paths to keys, public key optional as it is usually included in private key file:
Set Variable [ $result ; Value: MBS("CURL.SetOptionSSHPrivateKeyfile"; $curl; "/Users/jameykey/.ssh/id_rsa") ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionSSHPublicKeyfile"; $curl; "/Users/jameykey/.ssh/id_rsa.pub") ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUserName"; $curl; CURL Test::Name) ]
#
# no password with private key!
// Set Variable [ $result ; Value: MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
#
# upload text or open a file path
Set Variable [ $d ; Value: "Just a little bit text. Have fun!" ]
Set Variable [ $result ; Value: MBS("CURL.SetInputText"; $curl; $d) ]
// Set Variable [ $result ; Value: MBS("CURL.OpenInputFile"; $curl; "/Users/test/Desktop/test.fmp12") ]
#
# do it!
Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ]
Set Field [ CURL Test::debug ; MBS("CURL.GetDebugAsText"; $curl) ]
Set Variable [ $result ; Value: MBS("CURL.Release"; $curl) ]
See also
- CURL.GetDebugAsText
- CURL.New
- CURL.Perform
- CURL.SetInputText
- CURL.SetOptionConnectionTimeout
- CURL.SetOptionSSHPrivateKeyfile
- CURL.SetOptionUpload
- CURL.SetOptionURL
- CURL.SetOptionUserName
- CURL.SetOptionVerbose
Blog Entries
Release notes
- Version 8.0
- Changed CURL.SetOptionCAINFO, CURL.SetOptionCAPATH, CURL.SetOptionCookieFile, CURL.SetOptionCookieJar, CURL.SetOptionIssuerCert, CURL.SetOptionNETRCFile, CURL.SetOptionRandomFile, CURL.SetOptionSSHPrivateKeyfile, CURL.SetOptionSSHPublicKeyfile, CURL.SetOptionSSLCert, CURL.SetOptionSSLKey to use always UTF-8 on Mac/Linux and on Mac do the unicode transformation for decomposed characters to avoid trouble with special characters in file paths.
Created 18th August 2014, last changed 10th June 2020
CURL.SetOptionSSHPrivateKeyfile - CURL.SetOptionSSLCert
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos