src/com/wherehoo/WHDatabaseCheck.java
/**
     * Verifies that <tt>datSHA</tt> signature sent by the client is the same 
     * as the signature of <tt>data</tt> calculated using secret fetched from the table in Wherehoo.
     * @param data data that was signed and which signature needs to be verified
     * @param datSHA a signature of the data. <tt>idt</tt>'s password is necessary to calculate this value.   
     * @param idt client's username
     * @return boolean value indicating whether <tt>datSHA</tt> is a valid signature
     */
Verifies that datSHA signature sent by the client is the same
as the signature of data calculated using secret fetched from the table in Wherehoo.
@param data data that was signed and which signature needs to be verified
@param datSHA a signature of the data. idt's password is necessary to calculate this value.
@param idt client's username
@return boolean value indicating whether datSHA is a valid signature
Verifies that datSHA signature sent by the client is the same as the signature of data calculated using secret fetched from the table in Wherehoo . @param data data that was signed and which signature needs to be verified @param datSHA a signature of the data . idt ' s password is necessary to calculate this value . @param idt client ' s username @return boolean value indicating whether datSHA is a valid signature
protected static synchronized boolean checkSignature(byte[] data, byte[] datSHA, String idt){  
	try{
	    byte[] databaseSHA;
	    databaseSHA = WHDatabaseCheck.SHAhash(data,fetchFromTable("users","userid",idt,"secret"));
	    return (java.util.Arrays.equals(databaseSHA,datSHA));
	}
	catch (SQLException sqle){
	    System.out.println("SQLException : "+sqle.getMessage());
	    return false;
	}
    }
protected static synchronized boolean checkSignature ( byte [ ] data , byte [ ] datSHA , String idt ) { try { byte [ ] databaseSHA ; databaseSHA = WHDatabaseCheck . SHAhash ( data , fetchFromTable ( "users" , "userid" , idt , "secret" ) ) ; return ( java . util . Arrays . equals ( databaseSHA , datSHA ) ) ; } catch ( SQLException sqle ) { System . out . println ( "SQLException : " + sqle . getMessage ( ) ) ; return false ; } }
Verifies that <tt>datSHA</tt> signature sent by the client is the same
 as the signature of <tt>data</tt> calculated using secret fetched from the table in Wherehoo.
Verifies that <tt > datSHA< / tt > signature sent by the client is the same as the signature of <tt > data< / tt > calculated using secret fetched from the table in Wherehoo .