1 2 29 30 package com.jcraft.jsch.jce; 31 32 import com.jcraft.jsch.HASH; 33 34 import java.security.*; 35 36 public class SHA1 implements HASH{ 37 MessageDigest md; 38 public int getBlockSize(){return 20;} 39 public void init() throws Exception { 40 try{ md=MessageDigest.getInstance("SHA-1"); } 41 catch(Exception e){ 42 System.err.println(e); 43 } 44 } 45 public void update(byte[] foo, int start, int len) throws Exception { 46 md.update(foo, start, len); 47 } 48 public byte[] digest() throws Exception { 49 return md.digest(); 50 } 51 } 52 | Popular Tags |