CA Get Certificate REST API - dogtagpki/pki GitHub Wiki

API v1

Request

  • Path: /ca/rest/certs/{id}

  • Method: GET

  • Query Parameters:

    • id: dec/hex serial number

Examples

API v1 with JSON
$ curl \
    -k \
    -s \
    -H "Accept: application/json" \
    https://localhost.localdomain:8443/ca/rest/certs/6 | python -m json.tool
{
    "id": "0x6",
    "IssuerDN": "CN=CA Signing Certificate,OU=pki-tomcat,O=EXAMPLE",
    "SubjectDN": "CN=PKI Administrator,[email protected],OU=pki-tomcat,O=EXAMPLE",
    "PrettyPrint": "...",
    "Encoded": "...",
    "PKCS7CertChain": "...",
    "NotBefore": "Tue Jun 08 09:21:09 BST 2021",
    "NotAfter": "Mon May 29 09:21:09 BST 2023",
    "Status": "VALID",
    "RevokedOn": null,
    "RevokedBy": null,
    "RevocationReason": null,
    "Nonce": null,
    "Link": {
        "rel": "self",
        "href": "https://localhost.localdomain:8443/ca/rest/certs/0x6",
        "type": "application/xml"
    }
}
API v1 with XML
$ curl \
    -k \
    -s \
    -H "Accept: application/xml" \
    https://localhost.localdomain:8443/ca/rest/certs/6 | xmllint --format -
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CertData id="0x6">
  <IssuerDN>CN=Certificate Authority,O=EXAMPLE</IssuerDN>
  <SubjectDN>CN=PKI Administrator,[email protected],OU=pki-tomcat,O=EXAMPLE</SubjectDN>
  <PrettyPrint>...</PrettyPrint>
  <Encoded>...</Encoded>
  <PKCS7CertChain>...</PKCS7CertChain>
  <NotBefore>Tue Aug 17 15:15:45 CDT 2021</NotBefore>
  <NotAfter>Mon Aug 07 15:15:45 CDT 2023</NotAfter>
  <Status>VALID</Status>
  <Link>
    <relationship>self</relationship>
    <href>https://localhost.localdomain:8443/ca/rest/certs/0x6</href>
  </Link>
</CertData>
⚠️ **GitHub.com Fallback** ⚠️