Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
UAPI Functions - DNSSEC::export_zone_key - Developer Documentation - cPanel Documentation
Child pages
  • UAPI Functions - DNSSEC::export_zone_key
Skip to end of metadata
Go to start of metadata

Description

This function exports a DNSSEC security key.

Important:

In cPanel & WHM version 76 and later, when you disable the DNS role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/export_zone_key?domain=example.com&key_id=12345


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Export a DNSSEC security key.
$sa_settings = $cpanel->uapi(
    'DNSSEC', 'export_zone_key',
    array(
        'domain'     => 'example.com',
        'key_id'     => '12345'
    )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# Export a DNSSEC security key.
my $vinz_clortho = $cpliveapi->uapi(
    'DNSSEC', 'export_zone_key',
    {
        'domain'     => 'example.com',
        'key_id'  	 => '12345'
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username DNSSEC export_zone_key domain=example.com key_id=12345


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "status":1,
   "errors":null,
   "messages":null,
   "data":{  
      "DNSSEC":{  
         	"domain": example.com,
			"key_content":"Private-key-format: v1.2\nAlgorithm: 8 (RSASHA256)\nModulus: 9i8AlGZkwKJj6HYZX+9OcOyCMQ0L9eHBaTg2Y83cVBSaIyiIWo54QpuiJ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ufbYkrTvE+vhV6AyF9xDsdEbYDYwe4s0+X0eFvgqPMHWicpxPSUWCNa7f/DUJGEIFE13yZg35twl7GkiuOjglzLN/Jxix3PN9loe5YE=\nExponent2: Mya4iAimzb7p1DfzcZnIY1ijyuEEDSRb7I8Qc2PDAjGdmRMOaV7twPnwS2XQXwNTG6Wyntsm+nlGokeJgevDtXdOSn4FxRIkXllnfow2a5yajSO9Mx6bdePG2kjuPKTmQ3195JnDJYRhqxrL566c351l7I2aE1AcUqKcdG3EU8c=\nCoefficient: T4dFDz5pQhVUQSjV0hhKHHZ1wBxiXdZeCFIfbyypWEdxGXdX2lIN264u9cGQhI+iExTEjZCaYASMBzOqnIhkHhj0M1DGYrhRCdTpgxmDwdcHniRl/XMxPGqpmsP4WFCBxmIbr3SdnqoiPMXix0SjWkHTisq5i09DBMNGIGQyqS8=\n\n"
			"key_id": 12345,
			"success":1
       } 
   },
   "metadata":null
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required.

The security key's domain.

A valid domain.example.com
key_idinteger

Required.

The security key's ID.

A valid integer.


12345

Returns

ReturnTypeDescriptionPossible valuesExample
domainstring

The security key's domain.

A valid domain.example.com
key_content stringThe content of the key, which includes the algorithm.A valid string.
 Click to view...
"Private-key-format: v1.2\nAlgorithm: 8 (RSASHA256)\nModulus: 9i8AlGZkwKJj6HYZX+9OcOyCMQ0L9eHBaTg2Y83cVBSaIyiIWo54QpuiJykiuFYYHihOi+LW8vfU9A9jXLBs7DaeDkXO49OqYxfgD1vwmztJeXCQlmgxqUeD181gtSTNO43uUMkCisZft+OsJ96bdUof1UeJ1+IuSENBr1TZgYjmzBgIkmjdv8T5muPaaDfeOISLJKGOG2gI0xlyQ39ppd3CeB90cpIvFpCGjNC8nGvIqN4oyny6NftcEhaRFudbEhB6t2gI362wS5ohERK1F1rBTt+mqUwszCv46Y6p3Za3PsebWK7fR6IT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JYRhqxrL566c351l7I2aE1AcUqKcdG3EU8c=\nCoefficient: T4dFDz5pQhVUQSjV0hhKHHZ1wBxiXdZeCFIfbyypWEdxGXdX2lIN264u9cGQhI+iExTEjZCaYASMBzOqnIhkHhj0M1DGYrhRCdTpgxmDwdcHniRl/XMxPGqpmsP4WFCBxmIbr3SdnqoiPMXix0SjWkHTisq5i09DBMNGIGQyqS8=\n\n"
key_idinteger

The security key's ID.

A valid integer.12345
success BooleanWhether the function succeeded.
  • 1 — The function succeeded.
  • 0 — The function failed.
1