A wireless device for operating an integrated universal integrated circuit card (iUICC), the wireless device comprising:
- 1) One or more first processors;
- 2) A first non-transitory computer-readable memory operatively connected to the one or more processors, the first non-transitory computer-readable memory having stored thereon:
- (i) an agent for communicating with a tamper resistant element (TRE) within the wireless device and a server system;
- and
- (ii) first machine-readable instructions that, when executed by the one or more first processors, using the agent, cause the one or more first processors to perform the steps of:
- (a) querying the TRE for (i) a set of cryptographic parameters and (ii) a firmware version supported by the TRE;
- (b) establishing a transport layer security (TLS) session with the server system, wherein the server system is authenticated using a first certificate for the server system;
- (c) sending (i) the set of cryptographic parameters and (ii) the firmware version to the server system through the TLS session;
- (d) receiving, through the TLS session, a second certificate of a server static public key for an elliptic curve Diffie-Hellman (ECDH) key exchange algorithm and the set of cryptographic parameters;
- (e) sending, to the TRE, the second certificate;
- (f) receiving, from the TRE, a primary platform ephemeral public key for the set of cryptographic parameters and a random number;
- (g) sending, to the server system, the primary platform ephemeral public key and the random number;
- (h) receiving, from the server system, a server ephemeral public key and a ciphertext of firmware for the iUICC, wherein the firmware includes a private key SK.EUICC.ECDSA;
- and
- (i) sending, to the TRE, the server ephemeral public key and the ciphertext;
- 3) One or more second processors for the TRE;
- and
- 4) a second non-transitory computer-readable memory operatively connected to the one or more second processors and internal to the TRE, the second non-transitory computer-readable memory having stored thereon
- (i) a certificate authority public key for the set of cryptographic parameters;
- (ii) a symmetric ciphering key;
- and
- (ii) second machine-readable instructions that, when executed by the one or more second processors cause the one or more second processors to perform steps of:
- (a) verifying the second certificate using the certificate authority public key;
- (b) generating a shared secret using the ECDH key exchange algorithm with the server ephemeral public key, the server static public key, and a primary platform ephemeral private key corresponding to the primary platform ephemeral public key;
- (c) decrypting the ciphertext using the shared secret key in order to read the random number and the firmware for the iUICC;
- (d) encrypting the firmware with the symmetric ciphering key;
- (e) storing the encrypted firmware in the first non-transitory computer-readable memory which is external to the TRE;
- and
- (f) storing a key K, a subscriber permanent identifier (SUPI), and the private key SK.EUICC.ECDSA for the firmware in the second non-transitory computer-readable memory.