Import private key

This function uploads a private key.

Note:

Due to the limited field length of HTTP GET method calls, you must use the HTTP POST method. For this reason, you cannot use a cPanel or Webmail session URL to call this function.

Important:

When you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and Web Server roles, the system disables this function.

Authorizations:
query Parameters
key
required
string <pem-private-key>

The key's contents.

Example: key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAyeiHvMuJuVk8ZEY6wMzUS1g0eWaHaIWmIRe+Qrn6SwiRrm1p\npsJCiGPPPQGOSg4FzrMXqE0zsi/Tk3hUO/EEsi7CcZe8cUanjlUeXhiwrb86FCMF\nOb9siRHQvlss7VCg8ZGXXTWZgf5yD3A1xPwdayYwF2Tc7GkNcZGUAI58geuYaq+U\nGiLczRGZep1IQ0b1cZnqDvGMx6AS6hiDqLISjnmXYY2OhG6Uyp+SuinjYzLPJ6eO\nN/7i9qqbcGmt0ssddmhR897+bTEom5SlSuyi03KZ9Rn4ZmNJgOsup9MclSBGxBys\nb6MuuM3N0/tF5QuwmDc8H6h2rNBP9vGV7RTTXQIDAQABAoIBAFS/WVoRRLmbjxG3\nuKl8UA9f8oaSVnu0vUpeoOl5Dmm4Kw2/tvzbxPlii3Xb1VGYGS/tVBy8atp74J6h\nfxm5zHLN1afAPMR/F41ShPCSBHapMUOKf4MBqhjOdYOw2Way1RsQNSxWdxxtJIr+\nWlNYTzDOUpk/KMvCPHZS2IBzTidpcFpDQ3pyDXjOoKJJH0EQWPtvxJNGrFqmU29D\n9WBqQemHnDrzg3s7JzQ5cGpbbCE+QX8IckNkslAkyhm771CtqWdeo+c45e6YfGcx\nKuAy1zGSVzQBuitzYoMUOL5olXLEj8fHzXd/cZP4yCyyabcGz2vi6luxF+28l1OL\nG1axyLECgYEA+bD5B+Y/Dp5hZ/uVR1bbvyraQpwbDesS1zgnJ53KOIl926dnWzIt\nUvM46+c9IF+UJrtzwIB6IvjAQioNFrK36bHgNGzNf9WQ54NN172qveaFLdW34z/i\nGR2ix/efm9OC41QREQ/5IKV07TibCwVazVBWascMPkH7FnguTvTCiosCgYEAzwJ+\nGPlIWjK+sqkK5JMUyuH43qAvgVfkZV906JpNRQH0Mob3bC0nXN95EoTwWXk68ULT\no1GHv9XLbj8e+Ok7kpJQZT5vEZnDN+cy3jdTLCvcjU5Q3ToImOTp9isSAFWRTbtk\nyabLNoIIsTR/ZwwPFTZcRiK2d8k7ZhcRKdfGnrcCgYAPZ06FoTukoDqsGoYkB4S4\n72DVmSHGIwlfg5ROylouULUV9ubWZmsLYfvR+cr4k0zlcsz6RDLEs4nQyx1RmCbm\nYNXPBiNLTpaI4b3MoGPHIVB3+mZEu60sFXr0UR9kkpDRi18eKVkaHXrwI3zVGjh2\n0Az0u2DS+mkOAs4AivLxbwKBgQC0XPqbLc+Bb0dCCREJmLD8GCkrZ6wcaQUB4krN\nQ2vhnVM0Fu5K3Yi3XapynUuA2aSmgtA9MxMw7MkjlHGa9DPIgBz2KZDCaBN0iMeE\nX/XivZCbucmxBxhohsLmjh5QFj3U2Vp2bBIQuvlx1EjQ8uvNUqDRJvuOoNFVIPH+\nYBeZPwKBgA//kXfNtNMHOpch699i3rgTzbRFDmGwsr1otzvJsXw7Pr2bM4WIzUJy\nG2SUSUlQRSZK4+BBKT9S0d7TynJD6X/6R7IBotZbfXs1myYxEsKj89/BQmr47x2h\nHjYVCClNoJlsbd5C2yu1R3PikweWGoVaxE3c+AN5knqjwJ0g21Cf\n-----END RSA PRIVATE KEY-----"
friendly_name
string

The key's friendly name.

Example: friendly_name=TestKey
Request Body schema: multipart/form-data

The certificate's contents.

crt
string <pem-private-key>

The key's contents.

friendly_name
string

The key's friendly name.

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --input=json --output=jsonpretty \
  --user=username \
  SSL \
  upload_key

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "upload_key",
  • "module": "SSL",
  • "result": {
    • "data": [
      • {
        • "created": 1569844800,
        • "ecdsa_curve_name": null,
        • "ecdsa_public": null,
        • "friendly_name": "TestKey",
        • "id": "bbe7e_16e2d_df7539f280eb1ecf6c1096190e41ada7",
        • "key_algorithm": "rsaEncryption",
        • "modulus": "a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db",
        • "modulus_length": 2048
        }
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}