Add encode and decode functions to signer