2024-05-15 15:20:32 -04:00
|
|
|
---
|
2023-12-11 20:30:44 -05:00
|
|
|
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
SPDX-License-Identifier: curl
|
|
|
|
Long: key
|
|
|
|
Arg: <key>
|
|
|
|
Protocols: TLS SSH
|
2024-05-15 15:20:32 -04:00
|
|
|
Help: Private key filename
|
2023-12-11 20:30:44 -05:00
|
|
|
Category: tls ssh
|
|
|
|
Added: 7.9.3
|
|
|
|
Multi: single
|
2024-05-15 15:20:32 -04:00
|
|
|
See-also:
|
|
|
|
- key-type
|
|
|
|
- cert
|
|
|
|
Example:
|
|
|
|
- --cert certificate --key here $URL
|
2023-12-11 20:30:44 -05:00
|
|
|
---
|
2024-05-15 15:20:32 -04:00
|
|
|
|
|
|
|
# `--key`
|
|
|
|
|
|
|
|
Private key filename. Allows you to provide your private key in this separate
|
2023-12-11 20:30:44 -05:00
|
|
|
file. For SSH, if not specified, curl tries the following candidates in order:
|
2024-05-15 15:20:32 -04:00
|
|
|
`~/.ssh/id_rsa`, `~/.ssh/id_dsa`, `./id_rsa`, `./id_dsa`.
|
2023-12-11 20:30:44 -05:00
|
|
|
|
|
|
|
If curl is built against OpenSSL library, and the engine pkcs11 is available,
|
|
|
|
then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in
|
2024-05-15 15:20:32 -04:00
|
|
|
a PKCS#11 device. A string beginning with `pkcs11:` is interpreted as a
|
2023-12-11 20:30:44 -05:00
|
|
|
PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option is set as
|
2024-05-15 15:20:32 -04:00
|
|
|
`pkcs11` if none was provided and the --key-type option is set as `ENG` if
|
2023-12-11 20:30:44 -05:00
|
|
|
none was provided.
|
|
|
|
|
|
|
|
If curl is built against Secure Transport or Schannel then this option is
|
|
|
|
ignored for TLS protocols (HTTPS, etc). Those backends expect the private key
|
|
|
|
to be already present in the keychain or PKCS#12 file containing the
|
|
|
|
certificate.
|