1 22 package org.jboss.security.srp; 23 24 import java.math.BigInteger ; 25 26 import org.jboss.security.Util; 27 28 38 public class SRPConf 39 { 40 41 public static class SRPParams 42 { 43 String modb64; 44 String genb64; 45 String comment; 46 BigInteger N; 47 BigInteger g; 48 SRPParams(String modb64, String genb64, String comment) 49 { 50 this.modb64 = modb64; 51 this.genb64 = genb64; 52 this.comment = comment; 53 } 54 public byte[] Nbytes() 55 { 56 return Util.fromb64(modb64); 57 } 58 public byte[] gbytes() 59 { 60 return Util.fromb64(genb64); 61 } 62 public BigInteger N() 63 { 64 if( N == null ) 65 N = new BigInteger (1, Util.fromb64(modb64)); 66 return N; 67 } 68 public BigInteger g() 69 { 70 if( g == null ) 71 g = new BigInteger (1, Util.fromb64(genb64)); 72 return g; 73 } 74 public String getComment() 75 { 76 return comment; 77 } 78 } 79 80 static SRPParams[] pre_params = { 81 new SRPParams("3Kn/YYiomHkFkfM1x4kayR125MGkzpLUDy3y14FlTMwYnhZkjrMXnoC2TcFAecNlU5kFzgcpKYUbBOPZFRtyf3", 82 "2", null), 83 new SRPParams("CbDP.jR6YD6wAj2ByQWxQxQZ7.9J9xkn2.Uqb3zVm16vQyizprhBw9hi80psatZ8k54vwZfiIeEHZVsDnyqeWSSIpWso.wh5GD4OFgdhVI3", 84 "2", null), 85 new SRPParams("iqJ7nFZ4bGCRjE1F.FXEwL085Zb0kLM2TdHDaVVCdq0cKxvnH/0FLskJTKlDtt6sDl89dc//aEULTVFGtcbA/tDzc.bnFE.DWthQOu2n2JwKjgKfgCR2lZFWXdnWmoOh", 86 "2", null), 87 new SRPParams("///////////93zgY8MZ2DCJ6Oek0t1pHAG9E28fdp7G22xwcEnER8b5A27cED0JTxvKPiyqwGnimAmfjybyKDq/XDMrjKS95v8MrTc9UViRqJ4BffZes8F//////////", 88 "7", "oakley prime 1"), 89 new SRPParams("Ewl2hcjiutMd3Fu2lgFnUXWSc67TVyy2vwYCKoS9MLsrdJVT9RgWTCuEqWJrfB6uE3LsE9GkOlaZabS7M29sj5TnzUqOLJMjiwEzArfiLr9WbMRANlF68N5AVLcPWvNx6Zjl3m5Scp0BzJBz9TkgfhzKJZ.WtP3Mv/67I/0wmRZ", 90 "2", null), 91 new SRPParams("F//////////oG/QeY5emZJ4ncABWDmSqIa2JWYAPynq0Wk.fZiJco9HIWXvZZG4tU.L6RFDEaCRC2iARV9V53TFuJLjRL72HUI5jNPYNdx6z4n2wQOtxMiB/rosz0QtxUuuQ/jQYP.bhfya4NnB7.P9A6PHxEPJWV//////////", 92 "5", "oakley prime 2"), 93 new SRPParams("3NUKQ2Re4P5BEK0TLg2dX3gETNNNECPoe92h4OVMaDn3Xo/0QdjgG/EvM.hiVV1BdIGklSI14HA38Mpe5k04juR5/EXMU0r1WtsLhNXwKBlf2zEfoOh0zVmDvqInpU695f29Iy7sNW3U5RIogcs740oUp2Kdv5wuITwnIx84cnO.e467/IV1lPnvMCr0pd1dgS0a.RV5eBJr03Q65Xy61R", 94 "2", null), 95 new SRPParams("dUyyhxav9tgnyIg65wHxkzkb7VIPh4o0lkwfOKiPp4rVJrzLRYVBtb76gKlaO7ef5LYGEw3G.4E0jbMxcYBetDy2YdpiP/3GWJInoBbvYHIRO9uBuxgsFKTKWu7RnR7yTau/IrFTdQ4LY/q.AvoCzMxV0PKvD9Odso/LFIItn8PbTov3VMn/ZEH2SqhtpBUkWtmcIkEflhX/YY/fkBKfBbe27/zUaKUUZEUYZ2H2nlCL60.JIPeZJSzsu/xHDVcx", 96 "2", null), 97 new SRPParams("2iQzj1CagQc/5ctbuJYLWlhtAsPHc7xWVyCPAKFRLWKADpASkqe9djWPFWTNTdeJtL8nAhImCn3Sr/IAdQ1FrGw0WvQUstPx3FO9KNcXOwisOQ1VlL.gheAHYfbYyBaxXL.NcJx9TUwgWDT0hRzFzqSrdGGTN3FgSTA1v4QnHtEygNj3eZ.u0MThqWUaDiP87nqha7XnT66bkTCkQ8.7T8L4KZjIImrNrUftedTTBi.WCi.zlrBxDuOM0da0JbUkQlXqvp0yvJAPpC11nxmmZOAbQOywZGmu9nhZNuwTlxjfIro0FOdthaDTuZRL9VL7MRPUDo/DQEyW.d4H.UIlzp", 98 "2", null), 99 }; 100 101 public int getPredefinedCount() 102 { 103 return pre_params.length; 104 } 105 public static SRPParams getPredefinedParams(int n) 106 { 107 return pre_params[n]; 108 } 109 public static SRPParams getDefaultParams() 110 { 111 return pre_params[6]; 112 } 113 } 114 | Popular Tags |