# Create self-signed SSL certificate

This function generates a self-signed SSL certificate.

Important:

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

Endpoint: GET /SSL/generate_cert
Version: 11.136.0.13
Security: BasicAuth

## Query parameters:

  - `countryName` (string, required)
    The two-letter country code.
    Example: "US"

  - `domains` (string, required)
    A comma-separated list of domains for which to generate the certificate.

  - `key_id` (string, required)
    The key's ID.
    Example: "example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3"

  - `localityName` (string, required)
    The certificate's city or locality name.
    Example: "Houston"

  - `organizationName` (string, required)
    The certificate's Organization Name.
    Example: "Organization"

  - `stateOrProvinceName` (string, required)
    The two-letter state or locality abbreviation.
    Example: "TX"

  - `emailAddress` (string)
    An email address to associate with the certificate.
    Example: "username@example.com"

  - `friendly_name` (string)
    A friendly name for the new certificate.

This parameter defaults to the domain's name for which you generated the
certificate.
    Example: "TestCert"

  - `organizationalUnitName` (string)
    The certificate's organizational unit or department name.
    Example: "Department"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "generate_cert"

  - `module` (string)
    The name of the module called.
    Example: "SSL"

  - `result` (object)

  - `result.data` (object)

  - `result.data.created` (integer)
    The certificate's creation date.
    Example: 1538308800

  - `result.data.domains` (array)
    A list of domains that the certificate covers.
    Example: ["example.com"]

  - `result.data.ecdsa_curve_name` (string,null)
    The ECDSA curve that the certificate's key uses.

* prime256v1
* secp384r1
* null — The certificate's key is not an ECDSA key.
    Enum: "prime256v1", "secp384r1"

  - `result.data.ecdsa_public` (string,null)
    The certificate's key's ECDSA compressed public point, in hexadecimal format.

* null — The certificate's key is not an ECDSA key.

  - `result.data.friendly_name` (string)
    The certificate's friendly name.
    Example: "TestCert"

  - `result.data.id` (string)
    The certificate's ID.
    Example: "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff"

  - `result.data.is_self_signed` (integer)
    Whether the certificate is self-signed.

* 1 — Self-signed.
* 0 — Not self-signed.
    Enum: 1, 0

  - `result.data.issuer.commonName` (string)
    The certificate's Common Name.
    Example: "example.com"

  - `result.data.issuer.organizationName` (string)
    The certificate's Organization Name.
    Example: "Organization"

  - `result.data.key_algorithm` (string)
    The certificate's key's algorithm.

* rsaEncryption — RSA.
* id-ecPublicKey — ECDSA.
    Enum: "rsaEncryption", "id-ecPublicKey"

  - `result.data.modulus` (string,null)
    The certificate's key's modulus, in hexadecimal format.

* null — The certificate's key is not an RSA key.
    Example: "a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db"

  - `result.data.modulus_length` (integer,null)
    The length, in bits, of the certificate's key's modulus.

* null — The certificate's key is not an RSA key.
    Example: 2048

  - `result.data.not_after` (integer)
    The date that the certificate expires.
    Example: 1569844800

  - `result.data.not_before` (integer)
    The certificate's start date.
    Example: 1538308800

  - `result.data.serial` (string)
    The certificate's serial number.
    Example: "01e57e4d92"

  - `result.data.signature_algorithm` (string)
    The certificate's OID hash algorithm signature.
    Example: "sha256WithRSAEncryption"

  - `result.data.subject.commonName` (string)
    The domain that issued the certificate.
    Example: "example.com"

  - `result.data.text` (string)
    The certificate's text.
    Example: "-----BEGIN CERTIFICATE-----\nMIIGBzCCA++gAwIBAgIFAeV+TZIwDQYJKoZIhvcNAQELBQAwUjELMAkGA1UECAwC\nVFgxEDAO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yv+mMAkGA1UdEwQCMAAwfgYDVR0jBHcwdYAUVzMw1V9zEOzKTbsZ+MMLRnVi\n/6ahVqRUMFIxCzAJBgNVBAgMAlRYMRAwDgYDVQQHDAdIb3VzdG9uMQswCQYDVQQG\nEwJVUzETMBEGA1UEAwwKbXJmcm9nLmNvbTEPMA0GA1UECgwGY1BhbmVsggUB5X5N\nkjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwFQYDVR0RBA4wDIIKbXJm\ncm9nLmNvbTANBgkqhkiG9w0BAQsFAAOCAgEArbNqSdABFWy8NbpDGDAoi2rpw/aM\nWu18iEAHmPg9YekIngNpxZg4b8SB4jrNSSqB0pK8asckxmAcho/pnAx4rOFibftd\nDmGzYxGN9h60JkVToWSn3UQ/0dbqfhfTbGiQvJHTNqB3pQVvWenMFRz9XEcpMDUj\n7UKR8v2xe5Y25yvNPVezYF2/x85awlOoSa00UlKgqh0OU+iuzQZ9T3wtk5uvlc7Z\nIEzBseIn3Kp/WG3P64Rxn95YT6QssKJ+pZ412yKM7vKdcuglNLTv5cx4ffKFN1jm\nanCmPXgYsUdAazmZVSjVuVN7d2+NL+SDVczZCdJ2Vhk5DPqv8ZnHUF7MT+K6vtQd\nJ16+pszCF55t9w5uPqur67/R00dCWLpxvHRRF8J+2Xverhmex5kR6a1nUlbP1oOP\nVq+EmcAL0PP6qdDr8fkjgvNyX7hT+cuiPBbxpY6XfDSlat5+5T2lJ1Ny6GWhBnaR\n35g3EF8ysu3AYQnDwtZrOrEa08lDN3mbrkT3ImSa5oZKgOrlpCZ0dzi8p4wSrboq\n9eZyqikEvuudz+VeQf1WR/6/FsyRq2PEtjgX1atWZiPfatN5f1YVxcElTvuMzyOP\nZXjpUs8MO+CHF1FwtKm52NNItIlnUY7KPpFU8L+oa8O2BMr91wi8NpTR2gd0F+jH\n21NkfEM7YlXzgMw=\n-----END CERTIFICATE-----\n"

  - `result.data.validation_type` (string,null)
    The certificate's validation type, if one exists.

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.
    Example: ["Certificate generated"]

  - `result.metadata` (object)

  - `result.status` (integer)
    * 1 — Success.
* 0 — Failed. Check the errors field for more details.
    Enum: 1, 0

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


