Afficher la cote du certificat

POST
https://daas.digicert.com/apicontroller/v1/sslrating/getCertificateRating

Obtenez la cote de sécurité globale et les risques et problèmes connus pour le certificat. Cette demande de point de terminaison permet à l'utilisateur final d'explorer ou de faire un lien avec la cote de sécurité d'un certificat unique et tous les éléments pertinents qui déterminent la cote globale.

cURL
curl -X POST \
  https://daas.digicert.com/apicontroller/v1/sslrating/getCertificateRating \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}' \
  -d '{
    "certId": "fb92ee3a2fd0cb6549e58c252f8787f467bfbeff",
    "accountId": "126993",
    "divisionIds": []
}'
Python
import requests

url = "https://daas.digicert.com/apicontroller/v1/sslrating/getCertificateRating"

payload = "{\n    \"certId\": \"fb92ee3a2fd0cb6549e58c252f8787f467bfbeff\",\n    \"accountId\": \"126993\",\n    \"divisionIds\": []\n}"
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json",
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://daas.digicert.com/apicontroller/v1/sslrating/getCertificateRating"

	payload := strings.NewReader("{\n    \"certId\": \"fb92ee3a2fd0cb6549e58c252f8787f467bfbeff\",\n    \"accountId\": \"126993\",\n    \"divisionIds\": []\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'POST',
  url: 'https://daas.digicert.com/apicontroller/v1/sslrating/getCertificateRating',
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' },
  body: 
   { certId: 'fb92ee3a2fd0cb6549e58c252f8787f467bfbeff',
     accountId: '126993',
     divisionIds: [] },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
200 OK
{
    "data": {
        "categories": [
            {
                "name": "CabForumCategory",
                "criteria": [
                    {
                        "name": "AuthorityInfoAccess",
                        "value": "",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": [
                            {
                                "name": "OCSP",
                                "value": "http://ocsp.ca.com",
                                "issues": null,
                                "colorCode": null
                            },
                            {
                                "name": "CaIssuers",
                                "value": "http://crt.url.com/RSADomainValidationSecureServerCA.crx",
                                "issues": null,
                                "colorCode": null
                            }
                        ],
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "CRLDistributionPoints",
                        "value": "http://crl.url.com/RSADomainValidationSecureServerCA.crx",
                        "issues": "null",
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "BasicConstraint",
                        "value": "Certificate Authority : No",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "ExtendedKeyUsage",
                        "value": "TLS Web Client Authentication,TLS Web Server Authentication",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "KeyUsage",
                        "value": "digitalSignature,keyEncipherment",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "CertPolicies",
                        "value": "Policy ID #1 : 1.3.6.1.4.1.6449.1.2.2.7,CPS URI : https://secure.url.com/CPS,Policy ID #2 : 2.23.140.1.2.1",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "InternalNames",
                        "value": "No",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    }
                ]
            },
            {
                "name": "CertStatusCategory",
                "criteria": [
                    {
                        "name": "IsCertValid",
                        "value": "Yes",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    }
                ]
            },
            {
                "name": "CertAttributeCategory",
                "criteria": [
                    {
                        "name": "EndEntityCertHashAlgorithmStrength",
                        "value": "SHA2 family",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "EndEntityCertKeyStrength",
                        "value": "RSA 2048",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "IsAliasMatchSAN",
                        "value": "Yes",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "CertType",
                        "value": "Domain Validation (DV)",
                        "issues": "true",
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    }
                ]
            },
            {
                "name": "KnownRisksCategory",
                "criteria": [
                    {
                        "name": "NoNullCharacterInCN",
                        "value": "Yes",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "SameKeyNotUsedInChain",
                        "value": "Yes",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "SingleCNInDN",
                        "value": "Yes",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    },
                    {
                        "name": "ValidCertContent",
                        "value": "Yes",
                        "issues": null,
                        "colorCode": null,
                        "message": null,
                        "data": null,
                        "suggestion": null,
                        "kbLink": null
                    }
                ]
            }
        ],
        "rating": "Secure",
         “ratingNotice”: “Restricted to Secure because of DV certificate. Upgrade to OV or EV certificate to improve  the rating.”,
        "isPrivateCert": false,
        "cn": "*.aparat.com",
        "certStatus": "Valid",
        "caType": "PUBLIC"
    }
}

Paramètres de demande

Nom Obligatoire/facultatif Type Description
accountId Obligatoire string ID de compte
divisionIds Facultatif array ID de la division.
certId Obligatoire string ID unique généré par DigiCert pour le certificat détecté sur le point de terminaison. Obtenez l'identifiant du certificat à partir de la demande List certificates (Liste des certificats).

Paramètres de réponse

Nom Type Description
data object Conteneur.
.. categories array Conteneur pour les critères d'évaluation qui déterminent la cote de sécurité.
.. .. name string Nom de la catégorie d'évaluation.
.. .. criteria array Conteneur pour les détails qui déterminent la cote de sécurité.
.. .. .. name string Critères d'évaluation.
.. .. .. value string Valeur du critère.
.. .. .. issues string L'existence ou non de risques pour la sécurité.
.. .. .. colorCode string Niveau d'alerte.
Valeurs possibles : 1=À risque (élevé), 2=Avertissement (moyen), null.
.. .. .. message string Résumé.
.. .. .. data array Conteneur pour les sous-catégories.
.. .. .. .. name string Critères d'évaluation.
.. .. .. .. value string Valeur du critère.
.. .. .. .. issues string L'existence ou non de risques pour la sécurité.
.. .. .. .. colorCode string Niveau d'alerte.
Valeurs possibles : 1=À risque (élevé), 2=Avertissement (moyen), null.
.. .. .. suggestion string Détails et/ou solution.
.. .. .. kbLink string Lien vers des informations complémentaires.
.. rating string Cote de sécurité du certificat, en fonction des normes en vigueur dans l'industrie et des paramètres du certificat.
.. ratingNotice string Notes supplémentaires concernant la cote de sécurité des certificats.
.. isPrivateCert bool Si le certificat est émis par une AC racine privée ou non.
.. cn string Nom commun.
.. certStatus string Statut du certificat.
.. caType string Type de source de l'autorité de certification, telle que publique ou privée.