CURL.SetOptionSSLKeyType
------------------------

Sets the format of the private key.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetOptionSSLKeyType"; curl; Value { ; Encoding } ) 

**MBS**( **"CURL.SetOptionSSLKeyType";** /\* Sets the format of the private key. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**; /\* The key type.e.g. "PEM" \*/   
**$Encoding**) /\* Optional; The text encoding for text parameter.   
Default is UTF-8.e.g. "UTF8" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Value | The key type. | "PEM" |  |
| 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](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "UTF8" | Optional |

### Result

Returns "OK" on success.

### Description

Sets the format of the private key.  
Pass a string as parameter. The string should be the format of your private key. Supported formats are "PEM", "DER" and "ENG".  
  
The format "ENG" enables you to load the private key from a crypto engine. In this case [CURL.SetOptionSSLKey](CURLSetOptionSSLKey.md) is used as an identifier passed to the engine. You have to set the crypto engine with [CURL.SetOptionSSLEngine](CURLSetOptionSSLEngine.md). "DER" format key file currently does not work because of a bug in OpenSSL.  
See also [SSLKEYTYPE](https://curl.haxx.se/libcurl/c/CURLOPT_SSLKEYTYPE.html) option in CURL manual.

### See also

- [CURL.SetOptionSSLCert](CURLSetOptionSSLCert.md)
- [CURL.SetOptionSSLCertBlob](CURLSetOptionSSLCertBlob.md)
- [CURL.SetOptionSSLCertType](CURLSetOptionSSLCertType.md)
- [CURL.SetOptionSSLEngine](CURLSetOptionSSLEngine.md)
- [CURL.SetOptionSSLKey](CURLSetOptionSSLKey.md)
- [CURL.SetOptionSSLKeyBlob](CURLSetOptionSSLKeyBlob.md)
- [CURL.SetOptionSSLOptions](CURLSetOptionSSLOptions.md)
- [CURL.SetOptionSSLVerifyPeer](CURLSetOptionSSLVerifyPeer.md)
- [CURL.SetOptionSSLVersion](CURLSetOptionSSLVersion.md)
- [CURL.SetOptionTLSAuthType](CURLSetOptionTLSAuthType.md)

### Blog Entries

- [Translating Insert from URL options for CURL to MBS Plugin calls](https://www.mbsplugins.de/archive/2020-12-14/Translating_Insert_from_URL_op/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 5th July 2015

  
[CURL.SetOptionSSLKeyBlob](CURLSetOptionSSLKeyBlob.md) - [CURL.SetOptionSSLOptions](CURLSetOptionSSLOptions.md)

[HTML Version](CURLSetOptionSSLKeyType.shtml)