apple-push-notifications


ECDsa Signing in .Net Core on Linux


I'm trying to create a C# implementation to send Pushes to Apple via their HTTP/2 APNS Endpoint with .Net core in Docker. Part of this requires sending an encrypted JWT Authorization Token along with the payload. With .Net core, I can sign the token when running on Windows, but when running in the Linux Docker image, it tips over loading the Key.
When running in the .net Core Docker Image, I get a platformnotsupported Exception on loading the key.
public static string SignES256(string privateKey, string header, string payload)
{
// This is the failing Call
CngKey key = CngKey.Import(Convert.FromBase64String(privateKey), CngKeyBlobFormat.Pkcs8PrivateBlob);
using (ECDsaCng dsa = new ECDsaCng(key))
{
var unsignedJwtData =
System.Convert.ToBase64String(Encoding.UTF8.GetBytes(header)) + "." + System.Convert.ToBase64String(Encoding.UTF8.GetBytes(payload));
var unsignedJwtDataBytes = Encoding.UTF8.GetBytes(unsignedJwtData);
var signature =
dsa.SignData(unsignedJwtDataBytes, 0, unsignedJwtDataBytes.Length, HashAlgorithmName.SHA256 );
return unsignedJwtData + "." + System.Convert.ToBase64String(signature);
}
}
How can I do this from .Net Core on Linux?
Thanks.

Related Links

ios10 custom push notification sound not playing
How to set Title in Alert notification using Bluemix push notification service?
iOS 10 push notification previous payload structure not working which is working fine in iOS 9
Push Notifications stop working
How to send APNs push messages using APNs Auth Key and standard CLI tools?
Push Notifications Distribution doesn't work
IOS Push Notification with fcm
Test Push notification on TestFlight
Register push notification Swift 3 + iOS 10 [duplicate]
Apple Push Notification SSLHandshakeException
Configure APNS with eJabberD server?
UNUserNotificationCenter didRecieve Response is not called if App is terminated
Device Token for Push Notifications
Not able to send push notifications in APNS Dev environment using Amazon SNS
Simulating Apple Watch background push notifications PushNotificationPayload.apns
Trying to POST to APNS - System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel

Categories

HOME
openshift
lambda
weblogic12c
openxml
yahoo-weather-api
schema.org
enums
tcsh
elisp
stored-procedures
joomla3.2
sympy
siesta
slide
parsley.js
nsstring
circleci
rangy
powermock
spring-jpa
trace32
tomcat8
nose
spyder
weex
backtracking
kaggle
substring
jpa-2.1
running-object-table
math.js
jsonresult
premake
windowsiot
python-2.x
wampsharp
custom-keyboard
pdfminer
ftp-server
spinner
cargo
django-crispy-forms
ms-dos
telephonymanager
microkernel
newtons-method
ejml
expandablelistview
reverse-dns
sonarqube5.2
brightscript
ilrepack
simple-schema
gtk#
palindrome
mechanicalturk
mpmovieplayercontroller
prefetch
maatwebsite-excel
allegro
libharu
nsrunloop
jenkins-workflow
dojo-build
apache-pig-grunt
adjacency-list
gridbaglayout
dsa
bjam
angular-amd
artisan
componentart
mxe
nsmutabledata
pass-by-value
kognitio-wx2
encryption-symmetric
iodocs
osascript
zend-search-lucene
compiler-flags
jacob
html-frames
django-filebrowser
xmlwriter
gprof
system-requirements
zotonic
type-safety
quartz-core
kolite
net-use
mediacontroller
eaccelerator
uninstaller
android-input-method
self-tracking-entities
getimagesize
mysqli-multi-query
processors
subtext
xap
icon-language

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile