303. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:46 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

303.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm\encryption EncryptionToken.java Mon Dec 4 21:35:24 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm\encryption EncryptionToken.java Mon Dec 4 22:03:50 2017 UTC

303.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 246
Changed 2 4
Inserted 0 0
Removed 0 0

303.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

303.4 Active regular expressions

No regular expressions were active.

303.5 Comparison detail

  1   /**
  2    * 
  3     Package:  MAG - Vis tA Imaging
  4     WARNING:  Per VHA D irective 2 004-038, t his routin e should n ot be modi fied.
  5     Date Cre ated: Feb  21, 2012
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
WERFEJ
  8     Descript ion: 
  9  
  10           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  11           ;;  Property  of the US  Government .
  12           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  13           ;;  Use of un released v ersions of  this soft ware requi res the us er
  14           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  15           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  16           ;;   telephon e (301) 73 4-0100.
  17           ;;
  18           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  19           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  20           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  21           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  22           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  23           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  24  
  25    */
  26   package go v.va.med.i maging.tom cat.vistar ealm.encry ption;
  27  
  28   import gov .va.med.im aging.encr yption.Aes Encryption ;
  29   import gov .va.med.im aging.encr yption.exc eptions.Ae sEncryptio nException ;
  30   import gov .va.med.im aging.tomc at.vistare alm.VistaR ealmPrinci pal.Authen ticationCr edentialsT ype;
  31   import gov .va.med.im aging.tomc at.vistare alm.VistaR ealmSecuri tyContext;
  32   import gov .va.med.im aging.tran sactioncon text.Clien tPrincipal ;
  33   import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext;
  34   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  35   import gov .va.med.im aging.url. vista.Stri ngUtils;
  36  
  37   import jav a.util.Arr ayList;
  38   import jav a.util.Has hMap;
  39  
  40   import org .apache.lo gging.log4 j.LogManag er;
  41   import org .apache.lo gging.log4 j.Logger;
  42  
  43   /**
  44    * @author         
WERFEJ
  45    *
  46    */
  47   public cla ss Encrypt ionToken
  48   {
  49           pr ivate fina l static S tring deli miter = "| |";
  50           pr ivate fina l static S tring acce ssCode = " ";
  51           pr ivate fina l static S tring veri fyCode = " ";
  52           
  53           pu blic stati c String e ncryptUser Credential s()
  54           th rows AesEn cryptionEx ception
  55           {
  56                    Stri ngBuilder  sb = new S tringBuild er();
  57                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  58                    sb.a ppend(tran sactionCon text.getFu llName());  //0
  59                    sb.a ppend(deli miter);
  60                    sb.a ppend(tran sactionCon text.getDu z()); // 1
  61                    sb.a ppend(deli miter);
  62                    sb.a ppend(tran sactionCon text.getSs n()); // 2
  63                    sb.a ppend(deli miter);
  64                    sb.a ppend(tran sactionCon text.getSi teName());  // 3
  65                    sb.a ppend(deli miter);
  66                    sb.a ppend(tran sactionCon text.getSi teNumber() ); // 4
  67                    sb.a ppend(deli miter);
  68                    sb.a ppend(tran sactionCon text.getBr okerSecuri tyToken()) ; // 5
  69                    sb.a ppend(deli miter);
  70                    sb.a ppend(acce ssCode); / /6
  71                    sb.a ppend(deli miter);
  72                    sb.a ppend(veri fyCode); / / 7
  73                    retu rn AesEncr yption.enc rypt(sb.to String());
  74           }
  75           
  76           pu blic stati c void dec ryptUserCr edentials( String enc ryptedPara meters)
  77           th rows AesEn cryptionEx ception
  78           {
  79                    // d ecrypt and  put into  transactio n context
  80                    Stri ng decrypt edParamete rs = AesEn cryption.d ecodeByteA rray(encry ptedParame ters);                  
  81                    Stri ng [] piec es = Strin gUtils.Spl it(decrypt edParamete rs, delimi ter);            
  82                    Stri ng fullNam e = pieces [0];
  83                    Stri ng duz = p ieces[1];
  84                    Stri ng ssn = p ieces[2];
  85                    Stri ng siteNam e = pieces [3];
  86                    Stri ng siteNum ber = piec es[4];
  87                    Stri ng brokerS ecurityTok en = piece s[5];
  88                    LogM anager.get Logger("go v.va.med.i maging.tom cat.vistar ealm.encry ption.Encr yptionToke n").debug( "DUZ: "+du z);
  89                    LogM anager.get Logger("go v.va.med.i maging.tom cat.vistar ealm.encry ption.Encr yptionToke n").debug( "BSE Token : "+broker SecurityTo ken);
  90                    
  91                    
  92                    //St ring acces sCode = pi eces[6];
  93                    //if (accessCod e != null  && accessC ode.length () <= 0)
  94                    //       access Code = nul l;
  95                    //St ring verif yCode = pi eces[7];
  96                    //if (verifyCod e != null  && verifyC ode.length () <= 0)
  97                    //       verify Code = nul l;
  98                    //Lo gManager.g etLogger(" gov.va.med .imaging.t omcat.vist arealm.enc ryption.En cryptionTo ken").debu g("Access  Code: "+ac cessCode);
  99                    //Lo gManager.g etLogger(" gov.va.med .imaging.t omcat.vist arealm.enc ryption.En cryptionTo ken").debu g("Verify  Code: "+ve rifyCode);
  100                    
  101                    Clie ntPrincipa l principa l = new Cl ientPrinci pal(
  102                                      siteNumb er, true,A uthenticat ionCredent ialsType.P assword, 
  103                                      accessCo de, verify Code,
  104                                      duz, ful lName, ssn , siteNumb er, siteNa me,
  105                                      new Arra yList<Stri ng>(),
  106                                      new Hash Map<String , Object>( )
  107                    );
  108                    prin cipal.setA uthenticat edByVista( (accessCod e != null  && verifyC ode != nul l)); // tr ue if acce ss code an d verify c ode are sp ecified
  109                    Vist aRealmSecu rityContex t.set(prin cipal);
  110                    
  111                    //Tr ansactionC ontextFact ory.create ClientTran sactionCon text(princ ipal);
  112                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); 
  113                    tran sactionCon text.setBr okerSecuri tyApplicat ionName("V ISTA IMAGI NG VIX");
  114                    
  115                    /*
  116                    tran sactionCon text.setFu llName(pie ces[0]);
  117                    tran sactionCon text.setDu z(pieces[1 ]);
  118                    tran sactionCon text.setSs n(pieces[2 ]);
  119                    tran sactionCon text.setSi teName(pie ces[3]);
  120                    tran sactionCon text.setSi teNumber(s iteNumber) ;
  121                    */
  122                    tran sactionCon text.setBr okerSecuri tyToken(br okerSecuri tyToken);
  123           }
  124  
  125   }