You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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.

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)
{
   "apiversion":3,
   "module":"DNSSEC",
   "func":"export_zone_key",
   "result":{
      "errors":null,
      "data":{
         "key_content":"Private-key-format: v1.2\nAlgorithm: 8 (RSASHA256)\nModulus: r4w1MErk+LgSXWSwYJIXt79XWdYbsS0x07Cn1nDBLlIQL6iVZrbt6QoDS+OFEDLGZaxL8HoTS4TWqgdsdeYtJ2s2+vUfHZhwJoQd3ZFY0dVD/8qNVMnKdTPHvvJdX+gNkV6lTnKVqlcJ2zwt2EjMuCfNtDJPRwt8Sb9SrJDKzo2/05VrawtAmebPRDiWaFzdQ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tTdSI8KpR35EQQCrFzEafxkriX+ORIzAsWGjlvfmuD2ZzfvGgke/qGaKbm75FolRMAE5syoYb4CNO+d8G0UvHx3QwYDuJpT5fMKmmozPZJyrSz2BVcfurDqM0y0msn7KK06lawf5XwPw8cbkQjBG2XFAk=\nCoefficient: ujvSRL8oYCzgmFSm/bWo0/Cl2pxzg1FUHkeS2EvWwIMatWg8maUqVrAQaxIsaeffWnPesLfouSCEP4g8Jjru9wArDNxKEjv+tQsoSmwFNVcg71lY8n71c0YruDxdr8jMNlsGC+p6LHWH6sPT5gWTvaEVYycae/3Cv+BTG3D6sfE=\n\n",
         "success":1,
         "domain":"example.com",
         "key_id":"23",
         "key_tag" : 51640,
         "key_type" : "KSK"
      },
      "warnings":null,
      "messages":null,
      "metadata":{},
      "status":1
   }
}


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+mqUwszCv46Y6p3Za3PsebWK7fR6ITnsW7KGyn3r8BxpJTHlHMwOtBPosaXw==\nPublicExponent: AQAB\nPrivateExponent: MZO5nCkatSh+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1wBxiXdZeCFIfbyypWEdxGXdX2lIN264u9cGQhI+iExTEjZCaYASMBzOqnIhkHhj0M1DGYrhRCdTpgxmDwdcHniRl/XMxPGqpmsP4WFCBxmIbr3SdnqoiPMXix0SjWkHTisq5i09DBMNGIGQyqS8=\n\n"
key_idinteger

The security key's ID.

A valid integer.12345
key_tagintegerThe security key's internal identifier.A valid integer.51640
key_typestringThe security key's signing type.
  • CSK — Combined Signing Key.
  • KSK — Key Signing Key.
  • ZSK — Zone Signing Key.
KSK 
successBooleanWhether the function succeeded
  • 1 — The function succeeded.
  • 0 — The function failed.
1