A ticket is used to store data about an associated app and per-console information, such as encryption keys and whether or not the app is time-limited.
A ticket (BbTicket) consists of two parts: the content metadata for the app, and a ticket head (BbTicketHead).
|0x00||0x29AC||-||CMD||Content metadata for the associated app|
|0x29AC||0x04||uint32||bbId||ID of the console this ticket is for|
|0x29B0||0x02||uint16||tid||ticket ID; if bit 15 is set, then it is a trial ticket|
|0x29B2||0x02||uint16||code||What type of trial limitation: 0 or 2 = time, 1 = number of launches|
|0x29B4||0x02||uint16||limit||number of minutes, or number of launches, before limit is reached|
|0x29BC||0x10||uint8||cmdIv||titlekey_iv; IV used to re-encrypt title key (with ECDH key)|
|0x29CC||0x40||uint8||serverKey||ECC public key used with console's ECC private key to derive unique title key encryption key via ECDH|
|0x2A0C||0x40||uint8||issuer||Certificate used to sign the ticket|
|0x2A4C||0x100||uint8||ticketSign||RSA-2048 signature over all of the above and the CMD|