/// <inheritdoc/> public void RevokeCertificate(int accountId, RevokeCertificate @params) { // find order var x509 = new X509Certificate2(Base64Url.Decode(@params.Certificate)); var order = GetByCertificate(accountId, x509); // revoke RevokeCertificate(order, @params.Reason); }
/// <inheritdoc/> public void RevokeCertificate(JsonWebKey key, RevokeCertificate @params) { var x509 = new X509Certificate2(Base64Url.Decode(@params.Certificate)); throw new NotImplementedException($"Not implemented method {nameof(RevokeCertificate)}"); // todo see https://tools.ietf.org/html/rfc8555#section-7.6 // The server MUST also consider a revocation request valid if it is // signed with the private key corresponding to the public key in the // certificate. //var order = GetByCertificate(accountId, x509); //RevokeCertificate(order, @params.Reason); }
/// <summary> /// Revokes the certificate. /// </summary> /// <param name="certificate">The certificate.</param> /// <returns>The certificate revoked.</returns> public async Task <AcmeCertificate> RevokeCertificate(AcmeCertificate certificate) { var payload = new RevokeCertificate { Certificate = JwsConvert.ToBase64String(certificate.Raw), Resource = ResourceTypes.RevokeCertificate }; var uri = await this.handler.GetResourceUri(ResourceTypes.RevokeCertificate); var result = await this.handler.Post(uri, payload, key); ThrowIfError(result); certificate.Revoked = true; return(certificate); }