Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion PnP-IdentityModel.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
VisualStudioVersion = 15.0.27004.2002
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharePointPnP.IdentityModel.Extensions", "SharePointPnP.IdentityModel.Extensions\SharePointPnP.IdentityModel.Extensions.csproj", "{EB239573-1869-4DF4-8973-E01B7796DA02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharePointPnP.IdentityModel.Extensions.Test", "SharePointPnP.IdentityModel.Extensions.Test\SharePointPnP.IdentityModel.Extensions.Test.csproj", "{575BB00A-ED1B-4B68-9F1A-C7D3FAEE0806}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,8 +17,15 @@ Global
{EB239573-1869-4DF4-8973-E01B7796DA02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB239573-1869-4DF4-8973-E01B7796DA02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB239573-1869-4DF4-8973-E01B7796DA02}.Release|Any CPU.Build.0 = Release|Any CPU
{575BB00A-ED1B-4B68-9F1A-C7D3FAEE0806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{575BB00A-ED1B-4B68-9F1A-C7D3FAEE0806}.Debug|Any CPU.Build.0 = Debug|Any CPU
{575BB00A-ED1B-4B68-9F1A-C7D3FAEE0806}.Release|Any CPU.ActiveCfg = Release|Any CPU
{575BB00A-ED1B-4B68-9F1A-C7D3FAEE0806}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9F2D97AD-51E6-4004-A7D2-E6EF0E6E86B0}
EndGlobalSection
EndGlobal
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

This repository holds code related to authentication in SharePoint.

##SharePointPnP.IdentityModel.Extensions
Originally, Microsoft.IdentityModel.Extensions.dll is where the code for SharePoint provider-hosted apps OAuth and S2S token processing is located. Microsoft.IdentityModel.Extensions is not maintained by anyone, but SharePoint add-ins, SharePointPnP.Core and a few other things depend on it. SharePointPnP.IdentityModel.Extensions is a port of that library created by the PnP team. We reference it in OfficeDevPnP.Core (and all other supporting solutions) instead of depending on Microsoft.IdentityModel.Extensions.
## SharePointPnP.IdentityModel.Extensions

Originally, Microsoft.IdentityModel.Extensions.dll is where the code for SharePoint provider-hosted apps OAuth and S2S token processing is located. `Microsoft.IdentityModel.Extensions` is not maintained by anyone, but SharePoint add-ins, SharePointPnP.Core and a few other things depend on it. `SharePointPnP.IdentityModel.Extensions` is a port of that library created by the PnP team. We reference it in [OfficeDevPnP.Core](https://github.com/SharePoint/PnP-Sites-Core/tree/master/Core/OfficeDevPnP.Core) (and all other supporting solutions) instead of depending on `Microsoft.IdentityModel.Extensions`.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIC5DCCAdCgAwIBAgIQyGg2fpyqeZVFAMQL+pssrDAJBgUrDgMCHQUAMA8xDTAL
BgNVBAMTBFRlc3QwHhcNMTYxMjMxMjMwMDAwWhcNMTcxMjMxMjMwMDAwWjAPMQ0w
CwYDVQQDEwRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAycVE
3zBx1GX2TSGSFch9vwsfk3mPjkJztCGoyO/6taZxq2SiHo6SxzZhP46PQ4NeBV8A
kzIDlmAzbGETXYA5Ntign23m/wtCGVb521d+b+fAoiykrvLPp4+CvExjB8cDUIKS
na0w3WsdhPX2RzAQ8UU7bxPq1skExrdxj6+pAXBU0qp+l3aRwJlMJ3j7apWMV/a3
Tr4V8203QgtRoAnl4SEY8S+mtEGGfmCfX8WCLbLJdN/UssOIe/ZOGd1iKlL7h+BG
h/6V5N+rDwxMzCUdignCt8VAUv3jz47EAfgI9DrHnmDO7a0iJC4rHrNmU6Cs8UXM
WO2JMUcqn9PjOjWPpQIDAQABo0QwQjBABgNVHQEEOTA3gBB025fpt4u1ul5U+kmP
t0unoREwDzENMAsGA1UEAxMEVGVzdIIQyGg2fpyqeZVFAMQL+pssrDAJBgUrDgMC
HQUAA4IBAQBjaZQ7r83mLOsAOrCa1etjJXQ+VP6LIlExxEfQDpQdYMB/mElRfgjx
NSTmCMpmrVvSKoePZoqV0d0LHUvZP4s8UzEUGVUuO8XHXuRSh/1A0PlAVg0v5jMw
dxg4MBGYnYBHCGdYvYJFvfo3sgS7pgzhbj7yX1PPmpHBY2aXn3B24ZIi0tOUY4vX
Ve+J8uDe22D3DvpJI3l7BSQoTzwC5M/Rd1I4k9Vw649FFv6cXJWFbX70bDMkVq1Z
xkmXR1myjYzHnhDR4uOMmjCkyiSUycrMKTbQpKV1mSjPkGDllVYUbOFdH/dFDU68
mtH5KIdA0/npPZnzG0XTzH1YMIbG4JDD
-----END CERTIFICATE-----
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SharePointPnP.IdentityModel.Extensions.S2S.Tokens;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens;
using System.Security.Cryptography.X509Certificates;
using X509SigningCredentials = Microsoft.IdentityModel.SecurityTokenService.X509SigningCredentials;

namespace SharePointPnP.IdentityModel.Extensions.Test
{
[TestClass]
public class JwtTokenCreationTest
{
[TestMethod]
public void CreateTokenTest()
{
var certFile = @".\Certificate\Test.pfx";
var password = "Password1+";

var certificate = new X509Certificate2(certFile, password);
var signingCredentials = new X509SigningCredentials(certificate, SecurityAlgorithms.RsaSha256Signature, SecurityAlgorithms.Sha256Digest);

var actorClaims = new List<JsonWebTokenClaim>();
actorClaims.Add(new JsonWebTokenClaim(JsonWebTokenConstants.ReservedClaims.NameIdentifier, "TestName"));
var actorToken = new JsonWebSecurityToken(
issuer: "Test Issuer",
audience: "TestAudience",
validFrom: new DateTime(2017, 1, 1),
validTo: new DateTime(2017, 12, 31, 23, 59, 59),
signingCredentials: signingCredentials,
claims: actorClaims);

var actorTokenString = new JsonWebSecurityTokenHandler().WriteTokenAsString(actorToken);

Assert.IsNotNull(actorTokenString);
Assert.AreEqual("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjhMcjBkRjJGRC00QXlUbXhzNnh4enRqYUl6WSJ9.eyJhdWQiOiJUZXN0QXVkaWVuY2UiLCJpc3MiOiJUZXN0IElzc3VlciIsIm5iZiI6IjE0ODMyMjUyMDAiLCJleHAiOiIxNTE0NzYxMTk5IiwibmFtZWlkIjoiVGVzdE5hbWUifQ.Z_8DKOQiXldAMyJj2BGNzfJd2cTm_XqEcgsAOFyeKwHGJ9yx4uYUM9V7FAUFRPzW7fsb1I2LIS8RDo_riw9m5c8xeequ1noAYbydOZIDHuM9tefplCsve0_cIzek6lV0B0jykDj7OFtJMsDs9TQEtKcjVDGkBK4BnHUwUTLB_lYdzTjMm7WXOpFxz5c74tP5vaER1nuFhtftO5Hsy7jKyRRgdhKJ2o3Do_-LGdEfG9m51dUSb5E8odVGu1vGBQVsc88a11y5uFzORL7cm6hu2RwEELIzfd7bdHruQ9BB5mpS4AGzD4QxtHs2jgYXQ4-HqWFvnpJ-Z89_xWcmo-wOKA", actorTokenString);
}

[TestMethod]
public void CreateTwoTokensTest()
{
var certFile = @".\Certificate\Test.pfx";
var password = "Password1+";

var certificate = new X509Certificate2(certFile, password);
var signingCredentials = new X509SigningCredentials(certificate, SecurityAlgorithms.RsaSha256Signature, SecurityAlgorithms.Sha256Digest);

var actorClaims = new List<JsonWebTokenClaim>();
actorClaims.Add(new JsonWebTokenClaim(JsonWebTokenConstants.ReservedClaims.NameIdentifier, "TestName"));
var actorToken = new JsonWebSecurityToken(
issuer: "Test Issuer",
audience: "TestAudience",
validFrom: new DateTime(2017, 1, 1),
validTo: new DateTime(2017, 12, 31, 23, 59, 59),
signingCredentials: signingCredentials,
claims: actorClaims);

var tokenHandler = new JsonWebSecurityTokenHandler();
var firstActorTokenString = tokenHandler.WriteTokenAsString(actorToken);

Assert.IsNotNull(firstActorTokenString);
Assert.AreEqual("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjhMcjBkRjJGRC00QXlUbXhzNnh4enRqYUl6WSJ9.eyJhdWQiOiJUZXN0QXVkaWVuY2UiLCJpc3MiOiJUZXN0IElzc3VlciIsIm5iZiI6IjE0ODMyMjUyMDAiLCJleHAiOiIxNTE0NzYxMTk5IiwibmFtZWlkIjoiVGVzdE5hbWUifQ.Z_8DKOQiXldAMyJj2BGNzfJd2cTm_XqEcgsAOFyeKwHGJ9yx4uYUM9V7FAUFRPzW7fsb1I2LIS8RDo_riw9m5c8xeequ1noAYbydOZIDHuM9tefplCsve0_cIzek6lV0B0jykDj7OFtJMsDs9TQEtKcjVDGkBK4BnHUwUTLB_lYdzTjMm7WXOpFxz5c74tP5vaER1nuFhtftO5Hsy7jKyRRgdhKJ2o3Do_-LGdEfG9m51dUSb5E8odVGu1vGBQVsc88a11y5uFzORL7cm6hu2RwEELIzfd7bdHruQ9BB5mpS4AGzD4QxtHs2jgYXQ4-HqWFvnpJ-Z89_xWcmo-wOKA", firstActorTokenString);

var secondActorTokenString = tokenHandler.WriteTokenAsString(actorToken);

Assert.IsNotNull(secondActorTokenString);
Assert.AreEqual("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjhMcjBkRjJGRC00QXlUbXhzNnh4enRqYUl6WSJ9.eyJhdWQiOiJUZXN0QXVkaWVuY2UiLCJpc3MiOiJUZXN0IElzc3VlciIsIm5iZiI6IjE0ODMyMjUyMDAiLCJleHAiOiIxNTE0NzYxMTk5IiwibmFtZWlkIjoiVGVzdE5hbWUifQ.Z_8DKOQiXldAMyJj2BGNzfJd2cTm_XqEcgsAOFyeKwHGJ9yx4uYUM9V7FAUFRPzW7fsb1I2LIS8RDo_riw9m5c8xeequ1noAYbydOZIDHuM9tefplCsve0_cIzek6lV0B0jykDj7OFtJMsDs9TQEtKcjVDGkBK4BnHUwUTLB_lYdzTjMm7WXOpFxz5c74tP5vaER1nuFhtftO5Hsy7jKyRRgdhKJ2o3Do_-LGdEfG9m51dUSb5E8odVGu1vGBQVsc88a11y5uFzORL7cm6hu2RwEELIzfd7bdHruQ9BB5mpS4AGzD4QxtHs2jgYXQ4-HqWFvnpJ-Z89_xWcmo-wOKA", secondActorTokenString);

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("SharePointPnP.IdentityModel.Extensions.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SharePointPnP.IdentityModel.Extensions.Test")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: Guid("575bb00a-ed1b-4b68-9f1a-c7d3faee0806")]

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{575BB00A-ED1B-4B68-9F1A-C7D3FAEE0806}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SharePointPnP.IdentityModel.Extensions.Test</RootNamespace>
<AssemblyName>SharePointPnP.IdentityModel.Extensions.Test</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IdentityModel" />
</ItemGroup>
<ItemGroup>
<Compile Include="JwtTokenCreationTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Certificate\Test.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SharePointPnP.IdentityModel.Extensions\SharePointPnP.IdentityModel.Extensions.csproj">
<Project>{EB239573-1869-4DF4-8973-E01B7796DA02}</Project>
<Name>SharePointPnP.IdentityModel.Extensions</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" />
</Project>
5 changes: 5 additions & 0 deletions SharePointPnP.IdentityModel.Extensions.Test/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net47" />
<package id="MSTest.TestFramework" version="1.1.18" targetFramework="net47" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.IdentityModel.Tokens;
using System.Security.Cryptography;

namespace SharePointPnP.IdentityModel.Extensions.S2S.Tokens
{
/// <summary>
/// Factory that builds the necessary <see cref="SignatureProvider"/> based on the Cryptographic Service Provider we are getting from the
/// framework. Until .NET 4.6 the default Crypt Service Provider is <see cref="RSACryptoServiceProviderProxy"/>. Starting with .NET 4.7, we are getting RSACng.
/// </summary>
internal class AsymmetricSignatureProviderFactory
{
/// <summary>
/// Creates a signature provider for an asymmetric encryption scheme. The
/// </summary>
/// <param name="asymmetricSecurityKey">The <see cref="X509AsymmetricSecurityKey"/> asymmetric security key.</param>
/// <returns>A <see cref="SignatureProvider"/> that uses the crypto service provider associated with the <paramref name="asymmetricSecurityKey"/></returns>
/// <remarks>
/// Until .NET 4.6 the default Crypt Service Provider is <see cref="RSACryptoServiceProviderProxy"/>. Starting with .NET 4.7, we are getting RSACng.
/// </remarks>
public static SignatureProvider CreateSignatureProvider(X509AsymmetricSecurityKey asymmetricSecurityKey)
{
Utility.VerifyNonNullArgument("asymmetricSecurityKey", asymmetricSecurityKey);
#if NET46
var asymmetricAlgorithm = asymmetricSecurityKey.GetAsymmetricAlgorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", true);
if (asymmetricAlgorithm is RSACryptoServiceProvider)
{
return new X509AsymmetricSignatureProvider(asymmetricSecurityKey);
}
if (asymmetricAlgorithm is RSACng)
{
return new X509RsaCngAsymmetricSignatureProvider(asymmetricSecurityKey);
}

throw new System.InvalidOperationException(string.Format("Could not get asymmetric signature provider of type \"{0}\"", asymmetricAlgorithm.GetType().Name));
#else
//Older versions of the .NET Framework only know the RSACryptoServiceProvider. In this case, we can use the default implementation
return new X509AsymmetricSignatureProvider(asymmetricSecurityKey);
#endif
}
}
}
57 changes: 57 additions & 0 deletions SharePointPnP.IdentityModel.Extensions/S2S/Tokens/RSACngProxy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace SharePointPnP.IdentityModel.Extensions.S2S.Tokens
{
internal sealed class RSACngProxy : System.IDisposable
{
private bool _disposed;

private bool _disposeRsa;

private System.Security.Cryptography.RSACng _rsa;

public RSACngProxy(System.Security.Cryptography.RSACng rsa)
{
Utility.VerifyNonNullArgument("rsa", rsa);

this._rsa = rsa;
}

private void Dispose(bool disposing)
{
if (!this._disposed)
{
if (disposing && this._disposeRsa && this._rsa != null)
{
this._rsa.Dispose();
this._rsa = null;
}
this._disposed = true;
}
}

public byte[] SignData(byte[] signingInput, HashAlgorithmName hashAlgorithm)
{
var signaturePadding = RSASignaturePadding.Pkcs1;
return this._rsa.SignData(signingInput, hashAlgorithm, signaturePadding);

}

public bool VerifyData(byte[] signingInput, HashAlgorithmName hashAlgorithm, byte[] signature)
{
return this._rsa.VerifyData(signingInput, signature, hashAlgorithm, RSASignaturePadding.Pkcs1);

}

public void Dispose()
{
this.Dispose(true);
System.GC.SuppressFinalize(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static SignatureProvider Create(System.IdentityModel.Tokens.SigningCreden
System.IdentityModel.Tokens.X509AsymmetricSecurityKey x509AsymmetricSecurityKey = signingCredentials.SigningKey as System.IdentityModel.Tokens.X509AsymmetricSecurityKey;
if (x509AsymmetricSecurityKey != null)
{
return new X509AsymmetricSignatureProvider(x509AsymmetricSecurityKey);
return AsymmetricSignatureProviderFactory.CreateSignatureProvider(x509AsymmetricSecurityKey);
}
System.IdentityModel.Tokens.SymmetricSecurityKey symmetricSecurityKey = signingCredentials.SigningKey as System.IdentityModel.Tokens.SymmetricSecurityKey;
if (symmetricSecurityKey != null)
Expand Down
Loading