1 2 29 30 package com.jcraft.jsch.jce; 31 32 import java.security.SecureRandom ; 33 34 public class Random implements com.jcraft.jsch.Random{ 35 private byte[] tmp=new byte[16]; 36 private SecureRandom random=null; 37 public Random(){ 38 39 random=new SecureRandom (); 49 50 68 } 69 public void fill(byte[] foo, int start, int len){ 70 77 if(len>tmp.length){ tmp=new byte[len]; } 78 random.nextBytes(tmp); 79 System.arraycopy(tmp, 0, foo, start, len); 80 } 81 } 82 | Popular Tags |