3.1.5.1.3 Payload Decryption

The encrypted payload, which is the value of the EC attribute of the encrypted element, MUST be decrypted using the AES algorithm, as specified in [FIPS197] in CTR mode, as specified in [BCMO800-38A]. The per-space encryption key (section 3.1.3.1) matching the key identifier and key version that are values of the KID and KV attributes of the encrypted element MUST be used. The value of the IV attribute on the encrypted element MUST be used as the initialization vector.

The decrypted payload MUST be decompressed using WBXML, as specified in [WBXML1.2], and in section  2.2.1.2. The resulting XML element MUST be set as the content of the header element. The message is now ready for processing specific to the message type. The message type is determined by the tag of the header element.