code: func (ra *RegistrationAuthorityImpl) RevokeCertificateWithReg(ctx context.Context, cert x509.Certificate, revocationCode revocation.Reason, regID int64) error {
  	serialString := core.SerialToString(cert.SerialNumber)
  	var err error
  	if features.Enabled(features.RevokeAtRA) {
  		err = ra.revokeCertificate(ctx, cert, revocationCode)
  	} else {
  		err = ra.SA.MarkCertificateRevoked(ctx, serialString, revocationCode)
  	}
  
  	state := "Failure"
  	defer func() {
  		// Needed:
  		//   Serial
  		//   CN
  		//   DNS names
  		//   Revocation reason
  		//   Registration ID of requester
  		//   Error (if there was one)
  		ra.log.AuditInfof("%s, Request by registration ID: %d",
  			revokeEvent(state, serialString, cert.Subject.CommonName, cert.DNSNames, revocationCode),
  			regID)
  	}()
  
  	if err != nil {
  		state = fmt.Sprintf("Failure -- %s", err)
  		return err
  	}
  
  	state = "Success"
  	ra.stats.Inc("RevokedCertificates", 1)
  	return nil
  }
docs: // RevokeCertificateWithReg terminates trust in the certificate provided.