code: public static String getFingerprint(byte[] encoded, String algorithm)
  			throws SshException {
  
  		Digest md5 = (Digest) ComponentManager.getInstance().supportedDigests()
  				.getInstance(algorithm);
  
  		md5.putBytes(encoded);
  
  		byte[] digest = md5.doFinal();
  
  		StringBuffer buf = new StringBuffer();
  		int ch;
  		for (int i = 0; i < digest.length; i++) {
  			ch = digest[i] & 0xFF;
  			if (i > 0) {
  				buf.append(':');
  			}
  			buf.append(HEX[(ch >>> 4) & 0x0F]);
  			buf.append(HEX[ch & 0x0F]);
  		}
  
  		return buf.toString();
  	}
docs: Generate an SSH key fingerprint with a specific algorithm.
  
  @param encoded
  @param algorithm
  @return the key fingerprint, for example
  "c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87"