How to instantiate eSIM?

Verica Radulovic 0 Reputation points


I need to use instance of ESim class to do following:

  1. Discover profiles installed on the machine and show them on UI. Currently, I am mocking these. Eventually, I should be able to activate a profile from the list via my page.
  2. I have information about eSIM profile (provided with some API), and I need to install the profile.
  3. I need to be able to delete some of the installed profiles.

Now, to be able to do the above, I need to have some kind of ESim object, which I am not sure where to get from.

I am doing all this in the dark, because I don't have eSIM physically, but I am providing detailed log functionality to be able to keep track of what is going on on an actual eSIM machine.

Thanks in advance, Verica Radulovic

Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,310 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2023-09-15T08:45:01.3533333+00:00


    The ESim class in the Windows.Networking.NetworkOperators namespace represents an embedded SIM (eSIM, or eUICC) and can be used to manage SIM profiles. Here’s how you can use it to perform the tasks you mentioned:

    Discover Profiles: You can use the GetProfilesAsync method of the ESim class to get a list of all eSIM profiles installed on the device. This method returns a list of ESimProfile objects, each representing a profile installed on the eSIM.

    Install a Profile: To install a new profile, you can use the DownloadProfileMetadataAsync method of the ESim class. This method downloads the metadata for a new profile from a specified SM-DP+ server. After downloading the metadata, you can use the InstallProfileAsync method to install the profile on the eSIM.

    Delete a Profile: To delete an installed profile, you can use the DeleteAsync method of the ESimProfile class. This method deletes the profile from the eSIM.

    To get an instance of the ESim class, you can use the FromIdAsync static method of the ESim class. This method returns an ESim object that represents an eSIM with a specified ID.

    Please note that these methods are asynchronous and return their results via IAsyncOperation objects. You’ll need to use the await keyword to get their results in an asynchronous method.

    Also, please be aware that these methods may not work if you don’t have an actual eSIM installed on your device. You might want to consider getting an eSIM for testing purposes.