code: func (ca commandAPDU) serialize() ([]byte, error) {
  	buf := new(bytes.Buffer)
  
  	if err := binary.Write(buf, binary.BigEndian, ca.Cla); err != nil {
  		return nil, err
  	}
  	if err := binary.Write(buf, binary.BigEndian, ca.Ins); err != nil {
  		return nil, err
  	}
  	if err := binary.Write(buf, binary.BigEndian, ca.P1); err != nil {
  		return nil, err
  	}
  	if err := binary.Write(buf, binary.BigEndian, ca.P2); err != nil {
  		return nil, err
  	}
  	if len(ca.Data) > 0 {
  		if err := binary.Write(buf, binary.BigEndian, uint8(len(ca.Data))); err != nil {
  			return nil, err
  		}
  		if err := binary.Write(buf, binary.BigEndian, ca.Data); err != nil {
  			return nil, err
  		}
  	}
  	if err := binary.Write(buf, binary.BigEndian, ca.Le); err != nil {
  		return nil, err
  	}
  	return buf.Bytes(), nil
  }
docs: // serialize serializes a command APDU.