Пример #1
0
 public Task Revoke(IOrder order, RevokeReason reason)
 {
     return(Task.Run(() =>
     {
         // nothing
     }));
 }
Пример #2
0
        /// <summary>
        /// Revokes <see cref="ICertificate"/>
        /// </summary>
        /// <param name="order"><see cref="IOrder"/></param>
        /// <param name="reason">Revoke reason</param>
        public void RevokeCertificate(IOrder order, RevokeReason reason)
        {
            // revoke
            Task.Run(async() => await CertificateEnrollmentService.Revoke(order, reason))
            .Wait();

            // update status
            order.Certificate.Revoked = true;
            OrderRepository.Update(order);

            Logger.Info("Certificate {thumbprint} revoked", order.Certificate.Thumbprint);
        }
 /// <summary>
 /// Revoke certificate
 /// </summary>
 /// <remarks>
 /// https://tools.ietf.org/html/draft-ietf-acme-acme-18#section-7.6
 /// </remarks>
 public async Task RevokeCertificateAsync(
     byte[] derEncodedCertificate,
     RevokeReason reason      = RevokeReason.Unspecified,
     CancellationToken cancel = default(CancellationToken))
 {
     var message = new RevokeCertificateRequest
     {
         Certificate = CryptoHelper.Base64.UrlEncode(derEncodedCertificate),
         Reason      = reason
     };
     // If OK is returned, we're all done. Otherwise general
     // exception handling will kick in
     var resp = await SendAcmeAsync(
         new Uri(_http.BaseAddress, Directory.RevokeCert),
         method : HttpMethod.Post,
         message : message,
         expectedStatuses : new[] { HttpStatusCode.OK },
         cancel : cancel);
 }
Пример #4
0
        public static void RevokeCertificate(string caConfig, string certificateSerialNumber, RevokeReason reason = RevokeReason.CRL_REASON_CESSATION_OF_OPERATION)
        {
            const string binary = @"Binaries\RevokeCert\RevokeCert.exe";

            string args = "\"" + caConfig + "\" " + ((int)reason) + " " + certificateSerialNumber;

            ProcessStartInfo start = new ProcessStartInfo(binary);

            start.Arguments       = args;
            start.UseShellExecute = false;
            start.CreateNoWindow  = true;

            start.RedirectStandardError = true;

            Process proc = Process.Start(start);

            proc.WaitForExit();

            string error = proc.StandardError.ReadToEnd();

            if (proc.ExitCode != 0)
            {
                throw new Exception(error);
            }
        }
Пример #5
0
 /// <summary>
 /// Deletes a specified certificate.
 /// </summary>
 /// <param name="certificateId">The id of the certificate to be deleted.</param>
 /// <param name="reason">The reason the certificate is to be deleted.</param>
 /// <returns>Returns the deletion result.</returns>
 public SubmissionResult DeleteCertificate(string certificateId, RevokeReason reason)
 {
     return(this.Client.Delete <SubmissionResult>($"Certificate/{certificateId}?reason={reason}"));
 }
Пример #6
0
 /// <inheritdoc/>
 public Task Revoke(IOrder order, RevokeReason reason)
 {
     throw new MalformedException("Method not implemented");
 }