Added hashCode() and equals() in security classes