Package org.vngx.jsch.hash

Examples of org.vngx.jsch.hash.MAC.doFinal()


      synchronized( macsha1 ) {  // MAC is not thread-safe
        macsha1.init(_salt);
        byte[] hostBytes = Util.str2byte(_host);
        macsha1.update(hostBytes, 0, hostBytes.length);
        _hashedHost = new byte[macsha1.getBlockSize()];
        macsha1.doFinal(_hashedHost, 0);
      }
    } catch(Exception e) {
      throw new JSchException("Failed to create HashedHostKey: " + e, e);
    }
View Full Code Here


      synchronized( macsha1 ) {  // MAC is not thread-safe
        macsha1.init(_salt);
        byte[] hostBytes = Util.str2byte(host);
        macsha1.update(hostBytes, 0, hostBytes.length);
        byte[] hashValue = new byte[macsha1.getBlockSize()];
        macsha1.doFinal(hashValue, 0);
        return Arrays.equals(_hashedHost, hashValue);
      }
    } catch(Exception e) {
      throw new IllegalStateException("Failed to check HashedHostKey isMatched(): "+e, e);
    }
View Full Code Here

        discardMac.update(buffer.buffer, 0, len);
      }
      discard -= len;
    }
    if( discardMac != null ) {
      discardMac.doFinal(buffer.buffer, 0);
    }
    throw new JSchException("Inbound packet is corrupt: "+msg, reasonCode);
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.