diff options
author | Oren Novotny <oren@novotny.org> | 2015-10-18 17:11:21 -0400 |
---|---|---|
committer | Oren Novotny <oren@novotny.org> | 2015-10-18 17:11:21 -0400 |
commit | a7bf2de9d8978ac016b5a634658e9b86c4010369 (patch) | |
tree | 8e2b7cc1d207355676a512306edc7838a8b11e3c /crypto | |
parent | Change dotnet -> sys_runtime (diff) | |
download | BouncyCastle.NET-ed25519-a7bf2de9d8978ac016b5a634658e9b86c4010369.tar.xz |
Add support for .NET Core. Brings back filesystem-based operations
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/crypto.dotnet.csproj | 92 | ||||
-rw-r--r-- | crypto/crypto.dotnet.project.json | 17 | ||||
-rw-r--r-- | crypto/crypto.pcl2.csproj | 8 | ||||
-rw-r--r-- | crypto/packages.crypto.pcl2.config | 4 | ||||
-rw-r--r-- | crypto/src/cms/CMSProcessableFile.cs | 2 | ||||
-rw-r--r-- | crypto/src/openpgp/PgpLiteralDataGenerator.cs | 2 | ||||
-rw-r--r-- | crypto/src/openpgp/PgpUtilities.cs | 6 |
7 files changed, 114 insertions, 17 deletions
diff --git a/crypto/crypto.dotnet.csproj b/crypto/crypto.dotnet.csproj new file mode 100644 index 000000000..0c10e5744 --- /dev/null +++ b/crypto/crypto.dotnet.csproj @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> + <PropertyGroup> + <ProjectType>Local</ProjectType> + <ProductVersion>7.10.3077</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{38872A5F-E87E-4FAD-B109-8EB7B2E6A4A2}</ProjectGuid> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ApplicationIcon /> + <AssemblyKeyContainerName /> + <AssemblyName>crypto</AssemblyName> + <AssemblyOriginatorKeyFile>BouncyCastle.snk</AssemblyOriginatorKeyFile> + <DefaultClientScript>JScript</DefaultClientScript> + <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> + <DefaultTargetSchema>IE50</DefaultTargetSchema> + <DelaySign>false</DelaySign> + <OutputType>Library</OutputType> + <RootNamespace>crypto</RootNamespace> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <StartupObject /> + <TargetFrameworkVersion>v5.0</TargetFrameworkVersion> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <TargetFrameworkProfile> + </TargetFrameworkProfile> + <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> + <NuGetPackageImportStamp> + </NuGetPackageImportStamp> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <OutputPath>bin\dotnet\Debug\</OutputPath> + <IntermediateOutputPath>obj\dotnet\Debug\</IntermediateOutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile /> + <DefineConstants>TRACE;DEBUG;PORTABLE;NO_THREADS;NEW_REFLECTION;SYS_RUNTIME;DOTNET</DefineConstants> + <DocumentationFile>doc\dotnet\crypto.xml</DocumentationFile> + <DebugSymbols>true</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn>1591</NoWarn> + <Optimize>false</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>full</DebugType> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\dotnet\Release\</OutputPath> + <IntermediateOutputPath>obj\dotnet\Release\</IntermediateOutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile /> + <DefineConstants>TRACE;PORTABLE;NO_THREADS;NEW_REFLECTION;SYS_RUNTIME;DOTNET</DefineConstants> + <DocumentationFile>doc\dotnet\crypto.xml</DocumentationFile> + <DebugSymbols>true</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn>1591</NoWarn> + <Optimize>true</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>pdbonly</DebugType> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup> + <SignAssembly>true</SignAssembly> + </PropertyGroup> + <ItemGroup> + <!-- NuSpec file must be specified as name does not match dll name --> + <NuSpecFile Include="$(SolutionDir)Portable.BouncyCastle.nuspec" /> + </ItemGroup> + <ItemGroup> + <None Include="BouncyCastle.snk" /> + <None Include="crypto.dotnet.project.json" /> + </ItemGroup> + <ItemGroup> + <Compile Include="src\**\*.cs" /> + <Compile Include="bzip2\**\*.cs" /> + </ItemGroup> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> + <PropertyGroup> + <PreBuildEvent /> + <PostBuildEvent /> + </PropertyGroup> +</Project> \ No newline at end of file diff --git a/crypto/crypto.dotnet.project.json b/crypto/crypto.dotnet.project.json new file mode 100644 index 000000000..e80002612 --- /dev/null +++ b/crypto/crypto.dotnet.project.json @@ -0,0 +1,17 @@ +{ + "supports": { + "net46.app": {}, + "uwp.10.0.app": {}, + "dnxcore50.app": {} + }, + "dependencies": { + "Microsoft.NETCore": "5.0.0", + "Microsoft.NETCore.Portable.Compatibility": "1.0.0", + "NuSpec.ReferenceGenerator": "1.3.4" + }, + "frameworks": { + "dotnet": { + "imports": "portable-net452+win81" + } + } +} \ No newline at end of file diff --git a/crypto/crypto.pcl2.csproj b/crypto/crypto.pcl2.csproj index 8d95bd0f6..62e76ee40 100644 --- a/crypto/crypto.pcl2.csproj +++ b/crypto/crypto.pcl2.csproj @@ -77,7 +77,6 @@ </ItemGroup> <ItemGroup> <None Include="BouncyCastle.snk" /> - <None Include="packages.crypto.pcl2.config" /> </ItemGroup> <ItemGroup> <Compile Include="src\**\*.cs" /> @@ -88,11 +87,4 @@ <PreBuildEvent /> <PostBuildEvent /> </PropertyGroup> - <Import Project="..\packages\NuSpec.ReferenceGenerator.1.3.4\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets" Condition="Exists('..\packages\NuSpec.ReferenceGenerator.1.3.4\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.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\NuSpec.ReferenceGenerator.1.3.4\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NuSpec.ReferenceGenerator.1.3.4\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets'))" /> - </Target> </Project> \ No newline at end of file diff --git a/crypto/packages.crypto.pcl2.config b/crypto/packages.crypto.pcl2.config deleted file mode 100644 index 5cc160b36..000000000 --- a/crypto/packages.crypto.pcl2.config +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="NuSpec.ReferenceGenerator" version="1.3.4" targetFramework="portable45-net45+win8+wpa81" developmentDependency="true" /> -</packages> \ No newline at end of file diff --git a/crypto/src/cms/CMSProcessableFile.cs b/crypto/src/cms/CMSProcessableFile.cs index f7509fa7b..46f88cd9f 100644 --- a/crypto/src/cms/CMSProcessableFile.cs +++ b/crypto/src/cms/CMSProcessableFile.cs @@ -1,4 +1,4 @@ -#if !PORTABLE +#if !PORTABLE || DOTNET using System; using System.IO; diff --git a/crypto/src/openpgp/PgpLiteralDataGenerator.cs b/crypto/src/openpgp/PgpLiteralDataGenerator.cs index 17a6eeef2..96078bf3e 100644 --- a/crypto/src/openpgp/PgpLiteralDataGenerator.cs +++ b/crypto/src/openpgp/PgpLiteralDataGenerator.cs @@ -141,7 +141,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp return new WrappedGeneratorStream(this, pkOut); } -#if !PORTABLE +#if !PORTABLE || DOTNET /// <summary> /// <p> /// Open a literal data packet for the passed in <c>FileInfo</c> object, returning diff --git a/crypto/src/openpgp/PgpUtilities.cs b/crypto/src/openpgp/PgpUtilities.cs index f982ae459..fc85dac52 100644 --- a/crypto/src/openpgp/PgpUtilities.cs +++ b/crypto/src/openpgp/PgpUtilities.cs @@ -347,7 +347,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp return MakeKey(algorithm, keyBytes); } -#if !PORTABLE +#if !PORTABLE || DOTNET /// <summary>Write out the passed in file as a literal data packet.</summary> public static void WriteFileToLiteralData( Stream output, @@ -382,8 +382,8 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp pOut.Write(buf, 0, len); } - pOut.Close(); - inputStream.Close(); + pOut.Dispose(); + inputStream.Dispose(); } #endif |