xref: /aosp_15_r20/external/curl/docs/cmdline-opts/key.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerLong: key
5*6236dae4SAndroid Build Coastguard WorkerArg: <key>
6*6236dae4SAndroid Build Coastguard WorkerProtocols: TLS SSH
7*6236dae4SAndroid Build Coastguard WorkerHelp: Private key filename
8*6236dae4SAndroid Build Coastguard WorkerCategory: tls ssh
9*6236dae4SAndroid Build Coastguard WorkerAdded: 7.9.3
10*6236dae4SAndroid Build Coastguard WorkerMulti: single
11*6236dae4SAndroid Build Coastguard WorkerSee-also:
12*6236dae4SAndroid Build Coastguard Worker  - key-type
13*6236dae4SAndroid Build Coastguard Worker  - cert
14*6236dae4SAndroid Build Coastguard WorkerExample:
15*6236dae4SAndroid Build Coastguard Worker  - --cert certificate --key here $URL
16*6236dae4SAndroid Build Coastguard Worker---
17*6236dae4SAndroid Build Coastguard Worker
18*6236dae4SAndroid Build Coastguard Worker# `--key`
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard WorkerPrivate key filename. Allows you to provide your private key in this separate
21*6236dae4SAndroid Build Coastguard Workerfile. For SSH, if not specified, curl tries the following candidates in order:
22*6236dae4SAndroid Build Coastguard Worker`~/.ssh/id_rsa`, `~/.ssh/id_dsa`, `./id_rsa`, `./id_dsa`.
23*6236dae4SAndroid Build Coastguard Worker
24*6236dae4SAndroid Build Coastguard WorkerIf curl is built against OpenSSL library, and the engine pkcs11 is available,
25*6236dae4SAndroid Build Coastguard Workerthen a PKCS#11 URI (RFC 7512) can be used to specify a private key located in
26*6236dae4SAndroid Build Coastguard Workera PKCS#11 device. A string beginning with `pkcs11:` is interpreted as a
27*6236dae4SAndroid Build Coastguard WorkerPKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option is set as
28*6236dae4SAndroid Build Coastguard Worker`pkcs11` if none was provided and the --key-type option is set as `ENG` if
29*6236dae4SAndroid Build Coastguard Workernone was provided.
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard WorkerIf curl is built against Secure Transport or Schannel then this option is
32*6236dae4SAndroid Build Coastguard Workerignored for TLS protocols (HTTPS, etc). Those backends expect the private key
33*6236dae4SAndroid Build Coastguard Workerto be already present in the keychain or PKCS#12 file containing the
34*6236dae4SAndroid Build Coastguard Workercertificate.
35