Skip to content

Commit

Permalink
Merge pull request #95 from 7702244/patch-1
Browse files Browse the repository at this point in the history
Get rid of Newtonsoft.Json
  • Loading branch information
coryjthompson authored Feb 6, 2024
2 parents 6437e9b + 0eb70e4 commit fce0a73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WebPush/Util/JwsSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using System.Text.Json;

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Check failure on line 5 in WebPush/Util/JwsSigner.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)
using Org.BouncyCastle.Crypto.Digests;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Crypto.Signers;
Expand Down Expand Up @@ -53,8 +53,8 @@ public string GenerateSignature(Dictionary<string, object> header, Dictionary<st

private static string SecureInput(Dictionary<string, object> header, Dictionary<string, object> payload)
{
var encodeHeader = UrlBase64.Encode(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(header)));
var encodePayload = UrlBase64.Encode(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(payload)));
var encodeHeader = UrlBase64.Encode(Encoding.UTF8.GetBytes(JsonSerializer.Serialize(header)));
var encodePayload = UrlBase64.Encode(Encoding.UTF8.GetBytes(JsonSerializer.Serialize(payload)));

return $"{encodeHeader}.{encodePayload}";
}
Expand All @@ -76,4 +76,4 @@ private static byte[] Sha256Hash(byte[] message)
return hash;
}
}
}
}

0 comments on commit fce0a73

Please sign in to comment.