Import certificate bundle
https://{managementIp}/rest/{version}/configuration/certificates/caBundle
- bundleAll: Imports all the certificates from certificate bundle into global-trusted-ca. This is a CPU intensive operation since it involves importing 250+ certificates.
- bundleCustom: Imports all the certificates of the Organizations given in request body into the global-trusted-ca.
- X509: Imports the certificate from the requestBody into a certificate-record and add it to the new global-trusted-ca object. Please note for this the certificate-record without a certificate must already be present in the config, and it's name should be provided in the request body
Request
-
version(required): string
REST API version string.
Available values: v1.2Allowed Values:[ "v1.2" ]
-
listName(required): string
Name of the global-trusted-ca to be created.
-
source(required): string
Source of CA-certificates to be importedAllowed Values:
[ "bundleAll", "bundleCustom", "X509" ]
-
Authorization(required):
The value in the Authorization header must be the string "
Bearer {access token}
", where{access token}
is a valid, unexpired token received in response to a prior/rest/{version}/auth/token
request.
- application/xml
object
-
certificate: string
Example:
-----BEGIN CERTIFICATE----- MIICzTCCAbUCAQAwVTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1BMRMwEQYDVQQH EwpCdXJsaW5ndG9uMRQwEgYDVQQKEwtFbmdpbmVlcmluZzEOMAwGA1UEAxMFdGVz tm7DBKYUNlwHXNNOwv/X54eHXskIxTcpR9aimrKpkPNt4DffotoyU6sVXHfQApAZk -----END CERTIFICATE-----
-
certificateRecord: string
Response
- application/xml
200 Response
object
object
400 Response
object
object
-
link: string
If available, a message with possible valid API URL(s) for the client to invokeExample:
Available URL(s) message string
401 Response
object
object
-
link: string
If available, a message with possible valid API URL(s) for the client to invokeExample:
Available URL(s) message string
404 Response
object
object
-
link: string
If available, a message with possible valid API URL(s) for the client to invokeExample:
Available URL(s) message string
423 Response
object
object
-
link: string
If available, a message with possible valid API URL(s) for the client to invokeExample:
Available URL(s) message string
Examples
Examples of Accessing the API
See Authenticate for how to acquire a token.
The following example shows how to create a global trusted CA list using curl.
curl -X PUT \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.2/configuration/certificates/caBundle?listName=global_list_core&source=bundleAll"
The following example shows how to create a global trusted CA list using Python.
import requests
headers = { "Accept":"application/xml", "Authorization":"Bearer " + token }
url = "https://" + sbcip + "/rest/v1.2/configuration/certificates/caBundle?listName=global_list_core&source=bundleAll"
resp = requests.put(url, headers=headers)
Note:
This example creates a global trusted CA list with the name "global_list_core" and imports all the certificates from certBundle into this list.Example of the Response Body
The following example shows the contents of the response body in XML.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<data>
<CABundle>
<listName>global_list_core</listName>
</CABundle>
</data>
<messages/>
<links/>
</response>
Example 2 of Accessing API
This example creates a custom bundle from a subset of the available certificates.
curl -X PUT \
-d@request.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.2/configuration/certificates/caBundle?listName=global_list_core_select&source=bundleCustom"
The following shows an example of the request body.
<?xml version="1.0" encoding="UTF-8"?>
<CABundle>
<organizationName>LuxTrustSA</organizationName>
<organizationName>SwissSignAG</organizationName>
<organizationName>NetLockKft</organizationName>
</CABundle>
The following shows an example response.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<data>
<CABundle>
<listName>global_list_core_select</listName>
</CABundle>
</data>
<messages/>
<links/>
</response>
Example 3 of Accessing API
This example adds an X.509 certificate to an existing custom bundle.
curl -X PUT \
-d@request.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.2/configuration/certificates/caBundle?listName=global_list_core_select&source=X509"
The following shows an example of the request body.
<?xml version="1.0" encoding="UTF-8"?>
<CABundle>
<certificateRecord>customCert</certificateRecord>
<certificate>-----BEGIN CERTIFICATE-----
MIIDyzCCArOgAwIBAgIDA+aUMA0GCSqGSIb3DQEBBQUAMIGLMQswCQYDVQQGEwJB
VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp
bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMRgwFgYDVQQLDA9BL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ZrfKTmlu7GhF8EX43Vq/H2xcjzfwerloxzUnVkbGnQfaSqDVCQY0+7l
4INXvhvi0B+tbDW+jbpf
-----END CERTIFICATE-----
</certificate>
</CABundle>
The following shows an example response.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<data>
<CABundle>
<listName>global_list_core_select</listName>
</CABundle>
</data>
<messages/>
<links/>
</response>