Skip to content

Commit

Permalink
Update .sln and .csproject
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzautke committed Dec 31, 2022
1 parent 1783e3c commit 8e3130e
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 7 deletions.
24 changes: 24 additions & 0 deletions CreativeCode.JWS.Tests/CreativeCode.JWS.Tests.csproj
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>
23 changes: 23 additions & 0 deletions CreativeCode.JWS.Tests/JwsTests.cs
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();
}
}
10 changes: 5 additions & 5 deletions JWS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCode.JWS", "JWS\CreativeCode.JWS.csproj", "{E356AFF7-7952-4E1E-BD8D-CAD2AC15AC62}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCode.JWS-Run", "JWS-Run\CreativeCode.JWS-Run.csproj", "{F6A408A0-4B3E-4591-BA26-9E4421E84D76}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreativeCode.JWS.Tests", "CreativeCode.JWS.Tests\CreativeCode.JWS.Tests.csproj", "{CFD51C61-645E-4817-A21A-2B96634B90ED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,9 +15,9 @@ Global
{E356AFF7-7952-4E1E-BD8D-CAD2AC15AC62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E356AFF7-7952-4E1E-BD8D-CAD2AC15AC62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E356AFF7-7952-4E1E-BD8D-CAD2AC15AC62}.Release|Any CPU.Build.0 = Release|Any CPU
{F6A408A0-4B3E-4591-BA26-9E4421E84D76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6A408A0-4B3E-4591-BA26-9E4421E84D76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6A408A0-4B3E-4591-BA26-9E4421E84D76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6A408A0-4B3E-4591-BA26-9E4421E84D76}.Release|Any CPU.Build.0 = Release|Any CPU
{CFD51C61-645E-4817-A21A-2B96634B90ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFD51C61-645E-4817-A21A-2B96634B90ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFD51C61-645E-4817-A21A-2B96634B90ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CFD51C61-645E-4817-A21A-2B96634B90ED}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
20 changes: 18 additions & 2 deletions JWS/CreativeCode.JWS.csproj
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>

0 comments on commit 8e3130e

Please sign in to comment.