示例#1
0
        public static POSTCertificateRevokeRequest.REASON MapRevokeReason(uint reason)
        {
            POSTCertificateRevokeRequest.REASON returnReason = POSTCertificateRevokeRequest.REASON.PRIVILEGE_WITHDRAWN;

            switch (reason)
            {
            case 1:
                returnReason = POSTCertificateRevokeRequest.REASON.KEY_COMPROMISE;
                break;

            case 3:
                returnReason = POSTCertificateRevokeRequest.REASON.AFFILIATION_CHANGED;
                break;

            case 4:
                returnReason = POSTCertificateRevokeRequest.REASON.SUPERSEDED;
                break;

            case 5:
                returnReason = POSTCertificateRevokeRequest.REASON.CESSATION_OF_OPERATION;
                break;
            }

            return(returnReason);
        }
示例#2
0
        public void RevokeCertificate(string certificateId, POSTCertificateRevokeRequest.REASON reason)
        {
            Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug);

            string rtnMessage = string.Empty;

            string      RESOURCE = $"v1/certificates/{certificateId}/revoke";
            RestRequest request  = new RestRequest(RESOURCE, Method.POST);

            POSTCertificateRevokeRequest body = new POSTCertificateRevokeRequest();

            body.reason = reason.ToString();

            request.AddJsonBody(body);
            SubmitRequest(request);

            Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug);
        }