How to use APNs Auth Key (.p8 file) in C#? : <p>I'm trying to send push notifications to iOS devices, using token-based authentication.</p>

<p>As required, I generated an APNs Auth Key in Apple's Dev Portal, and downloaded it (it's a file with p8 extension).</p>

<p>To send push notifications from my C# server, I need to somehow use this p8 file to sign my JWT tokens. How do I do that?</p>

<p>I tried to load the file to X509Certificate2, but X509Certificate2 doesn't seem to accept p8 files, so then I tried to convert the file to pfx/p12, but couldn't find a way to do that that actually works.</p>
