Get certificate details
get
/rest/{version}/configuration/certificates
Retrieves the imported certificate (CA signed and self signed) details. This request works only for a certificate-record, for which a certificate was already imported. The query string must include the recordName attribute and the format attribute. The value of recordName is the certificate-record to get and the format attribute is used for deciding the display format of the certificate. The order of these attributes in the query string does not matter.
Request
Path Parameters
-
version(required):
REST API version string.
Available values: v1.2
Query Parameters
-
format(required):
Format the certificate-record to be retrieved. Options are either 'detail' or 'pem'.
-
recordName(required):
Name of the certificate-record
Header Parameters
-
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.
Response
200 Response
OK - Requested certificate data is returned in detail format or in PEM format in response body.
400 Response
The request is malformed in some way or is missing required information and therefore cannot be processed.
401 Response
Unauthorized - Request lacks valid authentication credentials.
404 Response
Unsupported version ID in URI or certificate specified with recordName key attribute is not found or requested format is not supported.
Examples
Examples of Accessing the API
See Authenticate for how to acquire a token.
The following example shows how to get certificate details using curl.
curl -X GET \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.2/configuration/certificates?recordName=rest-server&format=detail"
The following example shows how to get certificate details using Python.
import requests
headers = { "Accept":"application/xml", "Authorization":"Bearer " + token }
url = "https://" + sbcip + "/rest/v1.2/configuration/certificates?recordName=rest-server&format=detail"
resp = requests.get(url, headers=headers)
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>
<CertificateRecordDetails>
<certificateRecord>rest-server</certificateRecord>
<data>
<version>3 (0x2)</version>
<serialNumber>11 (0xb)</serialNumber>
<signatureAlgorithm>sha1WithRSAEncryption</signatureAlgorithm>
<issuer>
<country>US</country>
<state>MA</state>
<locality>Burlington</locality>
<organization>Engineering</organization>
<commonName>Acme Packet MA</commonName>
<emailAddress>acme@example.com</emailAddress>
</issuer>
<validity>
<notBefore>2020-02-13T20:00:54Z</notBefore>
<notAfter>2025-02-12T20:00:54Z</notAfter>
</validity>
<subject>
<country>US</country>
<state>MA</state>
<organization>Eng</organization>
<commonName>Acme</commonName>
</subject>
<x509V3Extensions>X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
X509v3 Subject Key Identifier:
21:9D:E1:C3:E7:CA:4A:F7:B3:47:0F:4E:FB:F1:2B:31:8F:31:D5:12
X509v3 Authority Key Identifier:
keyid:D6:56:81:C0:7B:07:F5:3F:A2:18:A6:F5:70:8D:34:92:1B:73:EC:4C
DirName:/C=US/ST=MA/L=Burlington/O=Engineering/CN=Acme Packet MA/emailAddress=acme@example.com
serial:DA:76:D0:86:25:E5:AB:E4
X509v3 Key Usage:
Digital Signature, Key Encipherment
</x509V3Extensions>
</data>
</CertificateRecordDetails>
</data>
<messages/>
<links/>
</response>