Inclusion Criteria:
 - -  Subjects with pathologically confirmed newly diagnosed primary CNS diffuse large
     B-cell lymphoma (DLBCL) confirmed by one of the following:
       -  Brain biopsy or resection.
- -  Participants must not have any evidence or history of DLBCL outside of the CNS.
- -  Participants must not have received any chemotherapy or radiation therapy directed
     to PCNSL.
- -  Ability to understand and the willingness to sign a written informed consent form
     document.
- -  ECOG performance status ≤2 (Karnofsky ≥70% will be considered if related to PCNSL,
     see Appendix A).
- -  Participants must have adequate organ function as defined below.
- -  Absolute neutrophil count (ANC) ≥1000/µL.
- -  Hemoglobin ≥9.0 g/dL or ≥5.6 mmol/L (Criteria must be met without
          erythropoietin dependency and without packed red blood cell (pRBC) transfusion
          within last 2 weeks)
  -  Renal.
-- Creatinine ≤1.5 x ULN OR Measured or calculated creatinine clearance ≥40 mL/min
     for participant with creatinine levels >1.5 × institutional ULN (Creatinine
     clearance (CrCl) should be calculated per institutional standard.)
 
- -  Total bilirubin ≤1.5 x ULN OR direct bilirubin ≤ULN for participants with total
          bilirubin levels >1.5 x ULN.
- -  AST (SGOT) and ALT (SGPT) ≤2.5 × ULN (≤5 × ULN for participants with liver
          metastases)
  -  Coagulation.
--International normalized ratio (INR) OR prothrombin time (PT) and activated
     partial thromboplastin time (aPTT) ≤1.5 × ULN unless participant is receiving
     anticoagulant therapy as long as PT or aPTT is within therapeutic range of intended
     use of anticoagulants. 
- -  Participants must have negative HIV serology.
- -  Participants must have no history of organ transplantation or ongoing
     immunosuppressant therapy.
- -  Women of child-bearing potential (WOCBP), defined as all women physiologically
     capable of becoming pregnant, must have a negative serum pregnancy within 72 hours
     prior to registration.
- -  Women in the following categories are not considered WOCBP:
       -  Premenarchal.
- -  Premenopausal female with 1 of the following:
            -  Documented hysterectomy.
- -  Documented bilateral salpingectomy.
- -  Documented bilateral oophorectomy.
- -  Note: Documentation can come from the site personnel's review of the
          participant's medical records, medical examination, or medical history
          interview.
- -  Post-menopausal female is defined as no menses for 12 months without an alternative
     medical cause.
- -  A high follicle stimulating hormone (FSH) level in the postmenopausal range may
          be used to confirm a postmenopausal state in women not using hormonal
          contraception or hormonal replacement therapy (HRT).
However, in the absence of
          12 months of amenorrhea, confirmation with two FSH measurements in the
          postmenopausal range is required.
      
- -  Females on HRT and whose menopausal status is in doubt will be required to use
          one of the non-hormonal highly effective contraception methods if they wish to
          continue their HRT during the study.
Otherwise, they must discontinue HRT to
          allow confirmation of postmenopausal status before study enrollment.
 
- -  Women of child-bearing potential (WOCBP; see definition above), must agree to use a
     highly effective method of contraception consistently and correctly as described
     below during study treatment and for 120 days after study discontinuation.
Highly Effective Contraceptive Methods That Are User Dependent (Failure rate
          of < 1% per year when used consistently and correctly.)
           
Combined (estrogen- and progestogen- containing) hormonal contraception.                
Oral.                
Intravaginal.                
Transdermal.                
Injectable.           
Progestogen-only hormonal contraception b, c.                
Oral.                
Injectable.      
Highly Effective Methods That Have Low User Dependency (Failure rate of <1%
          per year when used consistently and correctly)
           
Progestogen- only contraceptive implant b, c.           
Intrauterine hormone-releasing system (IUS) b.           
Intrauterine device (IUD)
           
Bilateral tubal occlusion.           
Vasectomized partner: A vasectomized partner is a highly effective
               contraception method provided that the partner is the sole male sexual
               partner of the WOCBP and the absence of sperm has been confirmed. If not,
               an additional highly effective method of contraception should be used.
           
Sexual abstinence: Sexual abstinence is considered a highly effective
               method only if defined as refraining from heterosexual intercourse during
               the entire period of risk associated with the study treatment. The
               reliability of sexual abstinence needs to be evaluated in relation to the
               duration of the study and the preferred and usual lifestyle of the
               participant.
 
- -  NOTES: Use should be consistent with local regulations regarding the use of
     contraceptive methods for participants of clinical studies.
Typical use failure rates are lower than perfect-use failure rates (i.e.
          when used consistently and correctly).
      
If hormonal contraception efficacy is potentially decreased due to
          interaction with study treatment, condoms must be used in addition to the
          hormonal contraception during the treatment period and for at least during
          study treatment and for 120 days after study discontinuation after the last
          dose of study treatment.
      
If locally required, in accordance with Clinical Trial Facilitation Group
          (CTFG) guidelines, acceptable contraceptive implants are limited to those which
          inhibit ovulation.
 
- -  Male participants must to use at least one of the following methods of contraception
     starting with the first dose of study therapy through 120 days after the last dose
     of therapy:
       -  Be abstinent from penile-vaginal intercourse as their usual and preferred
          lifestyle (abstinent on a long term and persistent basis) and agree to remain
          abstinent.
- -  Use a male condom plus partner use of a contraceptive method with a failure
          rate of <1% per year as described in Eligibility criterion 3.1.
11 when having
          penile-vaginal intercourse with a woman of childbearing potential who is not
          currently pregnant.
 
- -  Note: Men with a pregnant or breastfeeding partner must agree to remain abstinent
     from penile- vaginal intercourse or use a male condom during each episode of penile
     penetration.
Exclusion Criteria:
 - -  Participants who cannot undergo MRI.
- -  Intraocular PCNSL without evidence of brain or spinal cord disease.
- -  Participants who are receiving any other investigational agents.
- -  History of allergic reactions or severe hypersensitivity reactions (≥grade 3)
     attributed to compounds of similar chemical or biologic composition to
     pembrolizumab, high-dose methotrexate, temozolomide, rituximab and/or any of its
     excipients.
- -  Has received prior therapy with an anti-PD-1, anti-PD-L1, or anti-PD-L2 agent or
     with an agent directed to another stimulatory or co-inhibitory T-cell receptor (eg,
     CTLA-4, OX-40, CD137)
  -  Has active autoimmune disease that has required systemic treatment in the past 2
     years (i.e. with use of disease modifying agents, corticosteroids or
     immunosuppressive drugs).
Replacement therapy (eg., thyroxine, insulin, or
     physiologic corticosteroid replacement therapy for adrenal or pituitary
     insufficiency, etc.) is not considered a form of systemic treatment. 
- -  Has received a live vaccine within 30 days prior to the first dose of study drug.
Examples of live vaccines include, but are not limited to, the following: measles,
     mumps, rubella, varicella/zoster (chicken pox), yellow fever, rabies, Bacillus
     Calmette-Guérin (BCG), and typhoid vaccine. Seasonal influenza vaccines for
     injection are generally killed virus vaccines and are allowed; however, intranasal
     influenza vaccines (eg, FluMist®) are live attenuated vaccines and are not allowed.
     COVID19 vaccines are allowed.
 
- -  Has a known additional malignancy that is progressing or has required active
     treatment within the past 3 years.
Note: Participants with basal cell carcinoma of
     the skin, squamous cell carcinoma of the skin, transitional cell carcinoma of
     urothelial cancer, or carcinoma in situ (e.g. breast carcinoma, cervical cancer in
     situ) that have undergone potentially curative therapy are not excluded.
 
- -  Has a history of (non-infectious) pneumonitis that required steroids or has current
     pneumonitis.
- -  Patient has poorly controlled diabetes mellitus with a glycosylated hemoglobin >8%
     or poorly controlled steroid-induced diabetes mellitus with a glycosylated
     hemoglobin of >8%.
- -  Unable to swallow capsules or disease significantly affecting gastrointestinal
     function, such as malabsorption syndrome, resection of the stomach or small bowel,
     or complete bowel obstruction.
- -  Concurrent administration of medications or foods that are moderate or strong
     inhibitors or strong inducers of cytochrome P450 (CYP) 3A4/5 (need to be
     discontinued 2 weeks before starting study treatment)
  -  Enzyme-inducing antiepileptic drugs (EIAED) need to be discontinued and switched to
     a non-EIAED 2 weeks prior to starting on trial drugs.
- -  Has a known history of Hepatitis B (defined as Hepatitis B surface antigen [HBsAg]
     reactive) or known active Hepatitis C virus (defined as HCV RNA [qualitative] is
     detected) infection.
- -  Has a known history of active TB (Bacillus Tuberculosis)
  -  Has a diagnosis of immunodeficiency or is receiving chronic systemic steroid therapy
     (in dosing exceeding 10 mg daily of prednisone equivalent)
  -  Patients who have undergone prior allogeneic stem cell transplant.
- -  Patients who have large pleural effusions, ascites or full body edema.
- -  Has known psychiatric or substance abuse disorders that would interfere with
     cooperation with the requirements of the trial.
-  Is pregnant or breastfeeding or expecting to conceive or father children within the
     projected duration of the study, starting with the screening visit through 120 days
     after the last dose of trial treatment