Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Sets the file path for the public key file.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
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 |
Returns "OK" on success.
See also SSH_PUBLIC_KEYFILE option in CURL manual.
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.GetDebugMessages"; $curl) ]
Set Variable [ $result ; Value: MBS("CURL.Release"; $curl) ]
Created 18th August 2014, last changed 17th February 2022