code: func (ra *RegistrationAuthorityImpl) revokeCertificate(ctx context.Context, cert x509.Certificate, code revocation.Reason) error {
  	now := time.Now()
  	signRequest := core.OCSPSigningRequest{
  		CertDER:   cert.Raw,
  		Status:    string(core.OCSPStatusRevoked),
  		Reason:    code,
  		RevokedAt: now,
  	}
  	ocspResponse, err := ra.CA.GenerateOCSP(ctx, signRequest)
  	if err != nil {
  		return err
  	}
  	serial := core.SerialToString(cert.SerialNumber)
  	nowUnix := now.UnixNano()
  	reason := int64(code)
  	err = ra.SA.RevokeCertificate(ctx, &sapb.RevokeCertificateRequest{
  		Serial:   &serial,
  		Reason:   &reason,
  		Date:     &nowUnix,
  		Response: ocspResponse,
  	})
  	if err != nil {
  		return err
  	}
  	purgeURLs, err := akamai.GeneratePurgeURLs(cert.Raw, ra.issuer)
  	if err != nil {
  		return err
  	}
  	_, err = ra.purger.Purge(ctx, &akamaipb.PurgeRequest{Urls: purgeURLs})
  	if err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // revokeCertificate generates a revoked OCSP response for the given certificate, stores
  // the revocation information, and purges OCSP request URLs from Akamai.