Redth / PushSharp

A server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM - Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!
Other
4.38k stars 1.52k forks source link

P8 file for IOS push notification #793

Open logicerpsolution opened 7 years ago

logicerpsolution commented 7 years ago

What version of PushSharp are you using? PushSharp.Apple :2.2.1.0

Describe your issue: I want to use P8 certificate with same . Can you share any example . If i used P8 certificate instead of P12 then getting this type of error.

An exception of type 'System.Security.Cryptography.CryptographicException' occurred in mscorlib.dll but was not handled in user code,Additional information: Cannot find the requested object.

What are the steps required to reproduce this issue? Change P12 path to P8

Please provide any Exception Stack Traces

An exception of type 'System.Security.Cryptography.CryptographicException' occurred in mscorlib.dll but was not handled in user code,Additional information: Cannot find the requested object.

sashok2k commented 6 years ago

Same question here

keshimp commented 6 years ago

@logicerpsolution @sashok2k

Same issue here exactly. Only thread I found pertaining to issue

keshimp commented 6 years ago

Update - just resolved this issue by re-encoding my certificate's key in base64

boemekeld commented 5 years ago

@keshimp can you provide an example or link of soluction?

therohin commented 4 years ago

@keshimp , Would it be possible for you to share the solution here? Did you have to use the teamID by any chance? Code sample would really help.

ErikDombi commented 4 years ago

Is there a solution to this yet? This is extremely frustrating. I cannot manage to load this file at all.

ErikDombi commented 4 years ago

@therohin My Solution: Created a .p12 file using Keychain Access on my Mac.

  1. Open Keychain Access and select "My Certificates" under the "Category" header on the left side of the screen
  2. Select the certificate "Apple Push Services: [App Identifier]" (Don't select the private key below it)
  3. Right click the certificate you selected and chose "Export [Cert Name]" from the context menu
  4. You can save the Certificate as whatever name, just make sure File Format is set to "Personal Information Exchange (.p12)"

Use this .p12 file with the library

therohin commented 4 years ago

@wickedlizerd , I already had p12 and wanted to move to p8 so we don't have to maintain it. I ended up creating a .Net core project and using basic HTTP2 API calls to APNS servers using JWT Tokens.