Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit dc473a1

Browse files
committed
Create test library for Cryptography.OpenSsl.
The RSAOpenSsl type currently has no unique API surface area, so it just includes the RSA test suite and defines the provider that suite requires.
1 parent bd6672e commit dc473a1

File tree

4 files changed

+961
-0
lines changed

4 files changed

+961
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
namespace System.Security.Cryptography.Rsa.Tests
5+
{
6+
public class RSAOpenSslProvider : IRSAProvider
7+
{
8+
public RSA Create()
9+
{
10+
return new RSAOpenSsl();
11+
}
12+
13+
public RSA Create(int keySize)
14+
{
15+
return new RSAOpenSsl(keySize);
16+
}
17+
}
18+
19+
public partial class RSAFactory
20+
{
21+
private static readonly IRSAProvider s_provider = new RSAOpenSslProvider();
22+
}
23+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<CLRTestKind>BuildAndRun</CLRTestKind>
7+
<ProjectGuid>{A05C2EF2-A986-448C-9C63-735CC17409AA}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AssemblyName>System.Security.Cryptography.OpenSsl.Tests</AssemblyName>
10+
<RootNamespace>System.Security.Cryptography.OpenSsl.Tests</RootNamespace>
11+
<UnsupportedPlatforms>Windows_NT</UnsupportedPlatforms>
12+
</PropertyGroup>
13+
<ItemGroup>
14+
<ProjectReference Include="..\src\System.Security.Cryptography.OpenSsl.csproj">
15+
<Project>{78452F3E-BA91-47E7-BB0F-02E8A5C116C4}</Project>
16+
<Name>System.Security.Cryptography.OpenSsl</Name>
17+
</ProjectReference>
18+
<ProjectReference Include="..\..\System.Security.Cryptography.Algorithms\src\System.Security.Cryptography.Algorithms.csproj">
19+
<Project>{81A05E2E-E3AE-4246-B4E6-DD5F31FB71F9}</Project>
20+
<Name>System.Security.Cryptography.Algorithms</Name>
21+
</ProjectReference>
22+
<ProjectReference Include="..\..\System.Security.Cryptography.Primitives\src\System.Security.Cryptography.Primitives.csproj">
23+
<Project>{D04A73AE-E418-4ACD-A132-7688435BE8B5}</Project>
24+
<Name>System.Security.Cryptography.Primitives</Name>
25+
</ProjectReference>
26+
</ItemGroup>
27+
<ItemGroup>
28+
<Compile Include="RSAOpenSslProvider.cs" />
29+
<Compile Include="$(CommonTestPath)\Cryptography\ByteUtils.cs">
30+
<Link>CommonTest\Cryptography\ByteUtils.cs</Link>
31+
</Compile>
32+
<Compile Include="$(CommonTestPath)\Cryptography\AlgorithmImplementations\RSA\EncryptDecrypt.cs">
33+
<Link>CommonTest\Cryptography\AlgorithmImplementations\RSA\EncryptDecrypt.cs</Link>
34+
</Compile>
35+
<Compile Include="$(CommonTestPath)\Cryptography\AlgorithmImplementations\RSA\ImportExport.cs">
36+
<Link>CommonTest\Cryptography\AlgorithmImplementations\RSA\ImportExport.cs</Link>
37+
</Compile>
38+
<Compile Include="$(CommonTestPath)\Cryptography\AlgorithmImplementations\RSA\KeyGeneration.cs">
39+
<Link>CommonTest\Cryptography\AlgorithmImplementations\RSA\KeyGeneration.cs</Link>
40+
</Compile>
41+
<Compile Include="$(CommonTestPath)\Cryptography\AlgorithmImplementations\RSA\RSAFactory.cs">
42+
<Link>CommonTest\Cryptography\AlgorithmImplementations\RSA\RSAFactory.cs</Link>
43+
</Compile>
44+
<Compile Include="$(CommonTestPath)\Cryptography\AlgorithmImplementations\RSA\SignVerify.cs">
45+
<Link>CommonTest\Cryptography\AlgorithmImplementations\RSA\SignVerify.cs</Link>
46+
</Compile>
47+
<Compile Include="$(CommonTestPath)\Cryptography\AlgorithmImplementations\RSA\TestData.cs">
48+
<Link>CommonTest\Cryptography\AlgorithmImplementations\RSA\TestData.cs</Link>
49+
</Compile>
50+
<Compile Include="$(CommonTestPath)\Streams\PositionValueStream.cs">
51+
<Link>CommonTest\Streams\PositionValueStream.cs</Link>
52+
</Compile>
53+
</ItemGroup>
54+
<ItemGroup>
55+
<None Include="project.json" />
56+
</ItemGroup>
57+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
58+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"dependencies": {
3+
"System.Console": "4.0.0-beta-*",
4+
"System.IO": "4.0.10-beta-*",
5+
"System.Runtime": "4.0.20-beta-*",
6+
"System.Runtime.Extensions": "4.0.10-beta-*",
7+
"xunit": "2.0.0-beta5-build2785",
8+
"xunit.abstractions.netcore": "1.0.0-prerelease",
9+
"xunit.assert": "2.0.0-beta5-build2785",
10+
"xunit.core.netcore": "1.0.1-prerelease",
11+
"xunit.runner.visualstudio": "0.99.9-build1021",
12+
"xunit.netcore.extensions": "1.0.0-prerelease-*"
13+
},
14+
"frameworks": {
15+
"dnxcore50": {}
16+
}
17+
}

0 commit comments

Comments
 (0)