Encode key parameters.

Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>