diff --git a/apdu/command.go b/apdu/command.go index 1d76f61..81398ec 100644 --- a/apdu/command.go +++ b/apdu/command.go @@ -24,7 +24,7 @@ func NewCommand(cla, ins, p1, p2 uint8, data []byte) *Command { } } -func (c *Command) serialize() ([]byte, error) { +func (c *Command) Serialize() ([]byte, error) { buf := new(bytes.Buffer) if err := binary.Write(buf, binary.BigEndian, c.Cla); err != nil { diff --git a/apdu/command_test.go b/apdu/command_test.go index 2fe13bc..6bfd5ef 100644 --- a/apdu/command_test.go +++ b/apdu/command_test.go @@ -37,7 +37,7 @@ func TestNewCommand(t *testing.T) { cmd := NewCommand(cla, ins, p1, p2, data) expected := "80 50 01 02 08 84 76 23 36 C5 18 7F E8 00" - result, err := cmd.serialize() + result, err := cmd.Serialize() assert.NoError(t, err) assert.Equal(t, expected, bytesToHexWithSpaces(result)) }