generate_signature moved to public