channels/smartcard: split encoding from calling