A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/LogicSoftware/WebPushEncryption below:

LogicSoftware/WebPushEncryption: Chrome/Mozilla push notifications payload encryption for .NET

Chrome/Mozilla push notifications payload encryption for .NET

LogicSoftware.WebPushEncryption can be installed via the nuget UI (as WebPushEncryption), or via the nuget package manager console:

PM> Install-Package WebPushEncryption
using LogicSoftware.WebPushEncryption;

//------------------------------------

var encryptedPayload = Encryptor.Encrypt(p256dh, auth, payload);

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, pushEndpoint);

// send encrypted payload instead of original
request.Content = new ByteArrayContent(encryptedPayload.Payload);
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
request.Content.Headers.ContentLength = encryptedPayload.Payload.Length;

// append public key and salt as headers
request.Content.Headers.ContentEncoding.Add("aesgcm");
request.Headers.Add("Crypto-Key", "keyid=p256dh;dh=" + encryptedPayload.Base64EncodePublicKey());
request.Headers.Add("Encryption", "keyid=p256dh;salt=" + encryptedPayload.Base64EncodeSalt());

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4