-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1783e3c
commit 8e3130e
Showing
4 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> | ||
<PackageReference Include="NUnit" Version="3.13.3" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" /> | ||
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" /> | ||
<PackageReference Include="coverlet.collector" Version="3.1.2" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\JWS\CreativeCode.JWS.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Text; | ||
using CreativeCode.JWK.KeyParts; | ||
using Xunit; | ||
|
||
namespace CreativeCode.JWS.Tests; | ||
|
||
public class JwsTests | ||
{ | ||
|
||
[Fact] | ||
public void CompactJwsWithRsaSignatureCanBeSerialized() | ||
{ | ||
var keyUse = PublicKeyUse.Signature; | ||
var keyOperations = new HashSet<KeyOperation>(new[] {KeyOperation.ComputeDigitalSignature, KeyOperation.VerifyDigitalSignature}); | ||
var algorithm = Algorithm.RS256; | ||
var jwk = new JWK.JWK(algorithm, keyUse, keyOperations); | ||
var joseHeader = new ProtectedJoseHeader(jwk, "application/fhir+json", SerializationOption.JWSCompactSerialization); | ||
var payload = Encoding.UTF8.GetBytes("payload"); | ||
|
||
var jws = new JWS(joseHeader, payload); | ||
var json = jws.Export(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageVersion>0.1.0</PackageVersion> | ||
<Authors>Alexander Zautke</Authors> | ||
<NeutralLanguage>en-US</NeutralLanguage> | ||
<PackageLicenseUrl>https://github.com/alexzautke/JWS/blob/master/LICENSE</PackageLicenseUrl> | ||
<Owners>Alexander Zautke</Owners> | ||
<PackageProjectUrl>https://github.com/alexzautke/JWS/</PackageProjectUrl> | ||
<Title>CreativeCode.JWS</Title> | ||
<ReleaseVersion>0.1.0</ReleaseVersion> | ||
<SynchReleaseVersion>false</SynchReleaseVersion> | ||
<Summary>C# JWKs - JSON Web Keys (RFC7517)</Summary> | ||
<IsPackable>true</IsPackable> | ||
<PackageId>CreativeCode.JWS</PackageId> | ||
<PackageTags>JSON;JWK;JOSE;RFC7517;Digital Signature;</PackageTags> | ||
<Description>C# JWKs - JSON Web Keys (RFC7517)</Description> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" /> | ||
<PackageReference Include="CreativeCode.JWK" Version="0.6.0" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> | ||
</ItemGroup> | ||
</Project> |