SIO-1564 Unify 'generate_key' througout the code.

Change-Id: I05d83b9319ad13a5bc6b5d121fcd13c4e82e68ee