
This resource address creates a new certificate template in the Security database.
| URL Parameters | |
|---|---|
| format | The format of the posted data. Can be either
html, json, or xml (default). This value overrides
the Accept header if both are present. |
Upon success, MarkLogic Server returns status code 201 (Created). If the certificate template already exists or if the payload is malformed, a status code of 400 (Bad Request) is returned. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges.
manage-admin and security rolehttp://marklogic.com/xdmp/privileges/manage
http://marklogic.com/xdmp/privileges/manage-admin
http://marklogic.com/xdmp/privileges/get-user
http://marklogic.com/xdmp/privileges/xslt-invoke
The structure of the data in the request body is as follows. The name,
description, and csr properties are required.
key-options is essentially arbitrary XML. This cannot be encoded in JSON
without limitations. The JSON format therefore accepts only a subset of the possible key
option values. template-idtemplate-nametemplate-descriptiontemplate-versionkey-typekey-optionsThis is a complex structure with the following children:
key-lengthpass-phrasereqThis is a complex structure with the following children:
versionsubjectThis is a complex structure with the following children:
countryNamestateOrProvinceNamelocalityNameorganizationNameorganizationalUnitNameemailAddresscommonNamev3ext
cat myTemplate.json
==>
{
"template-name": "myTemplate",
"template-description": "My Template2",
"key-type": "rsa",
"key-options": {
"key-length": "2048"
},
"req": {
"version": "0",
"subject": {
"countryName": "US",
"stateOrProvinceName": "CA",
"localityName": "San Carlos",
"organizationName": "MarkLogic",
"organizationalUnitName": "Engineering",
"commonName": "dude.marklogic.com",
"emailAddress": "dude@marklogic.com"
}
}
}
curl -X POST --anyauth -u admin:admin --header "Content-Type:application/json" \
-d @myTemplate.json http://localhost:8002/manage/v2/certificate-templates
==> Creates a certificate template, named "myTemplate" in the Security database.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.