1. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/10/2017 1:01:42 PM Central Daylight 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.

1.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\AwivClientWebApp\main\src\java\gov\va\med\imaging\awiv\encryption EncryptionToken.java Thu Jun 29 17:22:53 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\AwivClientWebApp\main\src\java\gov\va\med\imaging\awiv\encryption EncryptionToken.java Fri Jul 7 16:32:57 2017 UTC

1.2 Comparison summary

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

1.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

1.4 Active regular expressions

No regular expressions were active.

1.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:          
R
E DACTED
  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.awi v.encrypti on;
  27  
  28   import jav a.util.Arr ayList;
  29   import jav a.util.Has hMap;
  30  
  31   import gov .va.med.im aging.encr yption.Aes Encryption ;
  32   import gov .va.med.im aging.encr yption.exc eptions.Ae sEncryptio nException ;
  33   import gov .va.med.im aging.tomc at.vistare alm.VistaR ealmSecuri tyContext;
  34   import gov .va.med.im aging.tomc at.vistare alm.VistaR ealmPrinci pal.Authen ticationCr edentialsT ype;
  35   import gov .va.med.im aging.tran sactioncon text.Clien tPrincipal ;
  36   import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext;
  37   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  38   import gov .va.med.im aging.url. vista.Stri ngUtils;
  39  
  40   /**
  41    * @author         
R
E DACTED
  42    *
  43    */
  44   public cla ss Encrypt ionToken
  45   {
  46           pr ivate fina l static S tring deli miter = "| |";
  47           
  48           pu blic stati c String e ncryptUser Credential s()
  49           th rows AesEn cryptionEx ception
  50           {
  51                    Stri ngBuilder  sb = new S tringBuild er();
  52                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  53                    sb.a ppend(tran sactionCon text.getFu llName());  //0
  54                    sb.a ppend(deli miter);
  55                    sb.a ppend(tran sactionCon text.getDu z()); // 1
  56                    sb.a ppend(deli miter);
  57                    sb.a ppend(tran sactionCon text.getSs n()); // 2
  58                    sb.a ppend(deli miter);
  59                    sb.a ppend(tran sactionCon text.getSi teName());  // 3
  60                    sb.a ppend(deli miter);
  61                    sb.a ppend(tran sactionCon text.getSi teNumber() ); // 4
  62                    sb.a ppend(deli miter);
  63                    sb.a ppend(tran sactionCon text.getBr okerSecuri tyToken()) ; // 5
  64                    sb.a ppend(deli miter);
  65                    sb.a ppend(tran sactionCon text.getAc cessCode()  == null ?  "" : tran sactionCon text.getAc cessCode() ); //6
  66                    sb.a ppend(deli miter);
  67                    sb.a ppend(tran sactionCon text.getVe rifyCode()  == null ?  "" : tran sactionCon text.getVe rifyCode() ); // 7
  68                    retu rn AesEncr yption.enc rypt(sb.to String());
  69           }
  70           
  71           pu blic stati c void dec ryptUserCr edentials( String enc ryptedPara meters)
  72           th rows AesEn cryptionEx ception
  73           {
  74                    // d ecrypt and  put into  transactio n context
  75                    Stri ng decrypt edParamete rs = AesEn cryption.d ecrypt(enc ryptedPara meters);                  
  76                    Stri ng [] piec es = Strin gUtils.Spl it(decrypt edParamete rs, delimi ter);            
  77                    
  78                    Stri ng fullNam e = pieces [0];
  79                    Stri ng duz = p ieces[1];
  80                    Stri ng ssn = p ieces[2];
  81                    Stri ng siteNam e = pieces [3];
  82                    Stri ng siteNum ber = piec es[4];
  83                    Stri ng brokerS ecurityTok en = piece s[5];
  84                    
  85                    Stri ng accessC ode = piec es[6];
  86                    if(a ccessCode  != null &&  accessCod e.length()  <= 0)
  87                             access Code = nul l;
  88                    Stri ng verifyC ode = piec es[7];
  89                    if(v erifyCode  != null &&  verifyCod e.length()  <= 0)
  90                             verify Code = nul l;
  91                    
  92                    Clie ntPrincipa l principa l = new Cl ientPrinci pal(
  93                                      siteNumb er, true,A uthenticat ionCredent ialsType.P assword, 
  94                                      accessCo de, verify Code,
  95                                      duz, ful lName, ssn , siteNumb er, siteNa me,
  96                                      new Arra yList<Stri ng>(),
  97                                      new Hash Map<String , Object>( )
  98                    );
  99                    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
  100                    Vist aRealmSecu rityContex t.set(prin cipal);
  101                    
  102                    //Tr ansactionC ontextFact ory.create ClientTran sactionCon text(princ ipal);
  103                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); 
  104                    tran sactionCon text.setBr okerSecuri tyApplicat ionName("V ISTA IMAGI NG VIX");
  105                    
  106                    /*
  107                    tran sactionCon text.setFu llName(pie ces[0]);
  108                    tran sactionCon text.setDu z(pieces[1 ]);
  109                    tran sactionCon text.setSs n(pieces[2 ]);
  110                    tran sactionCon text.setSi teName(pie ces[3]);
  111                    tran sactionCon text.setSi teNumber(s iteNumber) ;
  112                    */
  113                    tran sactionCon text.setBr okerSecuri tyToken(br okerSecuri tyToken);
  114           }
  115  
  116   }