Because this is using asymmetricencryption, where each side has its own certificate and private key, it should be somewhat simpler to handle than the Listing 5 symmetric-encryption example.
The key used for the data encryption is encrypted itself using an asymmetric algorithm with the public key associated with the Service Provider's X.509 certificate.