From 749ef30e4a8d43cccde6065d1eedef41bae2ec64 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 21 Nov 2015 18:04:39 +0700 Subject: Add build-related files from BouncyCastle-PCL --- BouncyCastle-PCL.sln | 46 +++++++++++ Portable.BouncyCastle.nuspec | 109 ++++++++++++++++++++++++++ crypto.tests.Net45/Properties/AssemblyInfo.cs | 36 +++++++++ crypto.tests.Net45/crypto.tests.Net45.csproj | 92 ++++++++++++++++++++++ crypto.tests.Net45/packages.config | 5 ++ crypto/crypto.Net45.csproj | 54 +++++++++++++ crypto/crypto.dotnet.csproj | 98 +++++++++++++++++++++++ crypto/crypto.dotnet.project.json | 17 ++++ crypto/crypto.pcl.csproj | 106 +++++++++++++++++++++++++ crypto/crypto.pcl2.csproj | 92 ++++++++++++++++++++++ 10 files changed, 655 insertions(+) create mode 100644 BouncyCastle-PCL.sln create mode 100644 Portable.BouncyCastle.nuspec create mode 100644 crypto.tests.Net45/Properties/AssemblyInfo.cs create mode 100644 crypto.tests.Net45/crypto.tests.Net45.csproj create mode 100644 crypto.tests.Net45/packages.config create mode 100644 crypto/crypto.Net45.csproj create mode 100644 crypto/crypto.dotnet.csproj create mode 100644 crypto/crypto.dotnet.project.json create mode 100644 crypto/crypto.pcl.csproj create mode 100644 crypto/crypto.pcl2.csproj diff --git a/BouncyCastle-PCL.sln b/BouncyCastle-PCL.sln new file mode 100644 index 000000000..afd9396fa --- /dev/null +++ b/BouncyCastle-PCL.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24606.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{43196EF9-B75F-4ABB-8967-DAFD621A7D05}" + ProjectSection(SolutionItems) = preProject + Portable.BouncyCastle.nuspec = Portable.BouncyCastle.nuspec + README.md = README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "crypto.pcl", "Crypto\crypto.pcl.csproj", "{38872A5F-E87E-4FAD-B109-8EB7B2E6A4A0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "crypto.tests.Net45", "crypto.tests.Net45\crypto.tests.Net45.csproj", "{45473847-8AF8-4BAF-B768-442C6875B8CE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "crypto.pcl2", "crypto\crypto.pcl2.csproj", "{38872A5F-E87E-4FAD-B109-8EB7B2E6A4A1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "crypto.dotnet", "crypto\crypto.dotnet.csproj", "{38872A5F-E87E-4FAD-B109-8EB7B2E6A4A2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A0}.Release|Any CPU.Build.0 = Release|Any CPU + {45473847-8AF8-4BAF-B768-442C6875B8CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45473847-8AF8-4BAF-B768-442C6875B8CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45473847-8AF8-4BAF-B768-442C6875B8CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45473847-8AF8-4BAF-B768-442C6875B8CE}.Release|Any CPU.Build.0 = Release|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A1}.Release|Any CPU.Build.0 = Release|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Portable.BouncyCastle.nuspec b/Portable.BouncyCastle.nuspec new file mode 100644 index 000000000..c58a23a80 --- /dev/null +++ b/Portable.BouncyCastle.nuspec @@ -0,0 +1,109 @@ + + + + Portable.BouncyCastle + 1.8.0-rc3 + Bouncy Castle PCL + Oren Novotny + onovotny + https://github.com/onovotny/BouncyCastle-PCL + false + BouncyCastle.Crypto is a cryptography API providing: + -Generation and parsing of PKCS#12 files. + -X.509: Generators and parsers for V1 and V3 certificates, V2 CRLs and attribute certificates. + -PBE algorithms supported by PBEUtil: PBEwithMD2andDES-CBC, PBEwithMD2andRC2-CBC, PBEwithMD5andDES-CBC, PBEwithMD5andRC2-CBC, PBEwithSHA1andDES-CBC, PBEwithSHA1andRC2-CBC, PBEwithSHA-1and128bitRC4, PBEwithSHA-1and40bitRC4, PBEwithSHA-1and3-keyDESEDE-CBC, PBEwithSHA-1and2-keyDESEDE-CBC, PBEwithSHA-1and128bitRC2-CBC, PBEwithSHA-1and40bitRC2-CBC, PBEwithHmacSHA-1, PBEwithHmacSHA-224, PBEwithHmacSHA-256, PBEwithHmacRIPEMD128, PBEwithHmacRIPEMD160, and PBEwithHmacRIPEMD256. + -Signature algorithms supported by SignerUtilities: MD2withRSA, MD4withRSA, MD5withRSA, RIPEMD128withRSA, RIPEMD160withRSA, RIPEMD256withRSA, SHA-1withRSA, SHA-224withRSA, SHA-256withRSAandMGF1, SHA-384withRSAandMGF1, SHA-512withRSAandMGF1, SHA-1withDSA, and SHA-1withECDSA. + -Symmetric key algorithms: AES, Blowfish, Camellia, CAST5, CAST6, DESede, DES, GOST28147, HC-128, HC-256, IDEA, NaccacheStern, RC2, RC4, RC5-32, RC5-64, RC6, Rijndael, Serpent, Skipjack, TEA/XTEA, Twofish, and VMPC. + -Symmetric key modes: CBC, CFB, CTS, GOFB, OFB, OpenPGPCFB, and SIC (or CTR). + -Symmetric key paddings: ISO10126d2, ISO7816d4, PKCS#5/7, TBC, X.923, and Zero Byte. + -Asymmetric key algorithms: RSA (with blinding), ElGamal, DSA, ECDSA. + -Asymmetric key paddings/encodings: ISO9796d1, OAEP, and PKCS#1. + -Digests: GOST3411, MD2, MD4, MD5, RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, Tiger, and Whirlpool. + -Signer mechanisms: DSA, ECDSA, ECGOST3410, GOST3410, ISO9796d2, PSS, RSA. + -Key Agreement: Diffie-Hellman and EC-DH. + -Macs: CBCBlockCipher, CFBBlockCipher, GOST28147, HMac, and ISO9797 Alg. 3. + -PBE generators: PKCS#12, and PKCS#5 - schemes 1 and 2. + -OpenPGP (RFC 2440) + -Cryptographic Message Syntax (CMS, RFC 3852), including streaming API. + -Online Certificate Status Protocol (OCSP, RFC 2560). + -Time Stamp Protocol (TSP, RFC 3161). + -TLS/SSL Client with support for client side authentication. + + Support for .NET 4, Windows Phone 8, Windows Phone App 8.1, Windows 8, MonoTouch, MonoAndroid, Xamarin.iOS, Core CLR + + en-US + bouncycastle, cryptography, encryption, security, PCL, wp8, wpa81, coreclr, dotnet, dnx, uwp, sl5, monotouch, monoandroid, xamarin, xamarin.ios + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/crypto.tests.Net45/Properties/AssemblyInfo.cs b/crypto.tests.Net45/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..52472faf8 --- /dev/null +++ b/crypto.tests.Net45/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("crypto.tests.Net45")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("crypto.tests.Net45")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("22ae3209-5ce9-448c-9212-04b9e8f6361e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/crypto.tests.Net45/crypto.tests.Net45.csproj b/crypto.tests.Net45/crypto.tests.Net45.csproj new file mode 100644 index 000000000..de668a83d --- /dev/null +++ b/crypto.tests.Net45/crypto.tests.Net45.csproj @@ -0,0 +1,92 @@ + + + + + Debug + AnyCPU + {45473847-8AF8-4BAF-B768-442C6875B8CE} + Library + Properties + crypto.tests + crypto.tests.Net45 + v4.5 + 512 + + + true + full + false + bin\Debug\ + TRACE;DEBUG;LIB;PORTABLE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;LIB;PORTABLE + prompt + 4 + + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll + False + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll + False + + + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll + False + + + ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll + False + + + + + + + + + + + + + + + %(RecursiveDir)%(Filename)%(Extension) + + + %(RecursiveDir)%(Filename)%(Extension) + + + + + {38872a5f-e87e-4fad-b109-8eb7b2e6a4a0} + crypto.pcl + + + + + + + + + + + \ No newline at end of file diff --git a/crypto.tests.Net45/packages.config b/crypto.tests.Net45/packages.config new file mode 100644 index 000000000..1f8800b2c --- /dev/null +++ b/crypto.tests.Net45/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/crypto/crypto.Net45.csproj b/crypto/crypto.Net45.csproj new file mode 100644 index 000000000..14b3581f5 --- /dev/null +++ b/crypto/crypto.Net45.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {45473847-8AF8-4BAF-B768-442C6875B8CF} + Library + Properties + crypto + crypto + v2.0 + 512 + + + + true + full + false + bin\Debug\ + TRACE;DEBUG;LIB;PCL;SILVERLIGHT + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;LIB;PCL;SILVERLIGHT + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/crypto/crypto.dotnet.csproj b/crypto/crypto.dotnet.csproj new file mode 100644 index 000000000..d9ae0db87 --- /dev/null +++ b/crypto/crypto.dotnet.csproj @@ -0,0 +1,98 @@ + + + + Local + 7.10.3077 + 2.0 + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A2} + Debug + AnyCPU + + + crypto + ..\BouncyCastle.snk + JScript + Grid + IE50 + false + Library + crypto + OnBuildSuccess + + v5.0 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + 14.0 + + + + + bin\dotnet\Debug\ + obj\dotnet\Debug\ + false + 285212672 + false + + TRACE;DEBUG;PORTABLE;NO_THREADS;NEW_REFLECTION;SYS_RUNTIME;DOTNET + doc\dotnet\crypto.xml + true + 4096 + false + 1591 + false + false + false + false + 4 + full + prompt + + + bin\dotnet\Release\ + obj\dotnet\Release\ + false + 285212672 + false + + TRACE;PORTABLE;NO_THREADS;NEW_REFLECTION;SYS_RUNTIME;DOTNET + doc\dotnet\crypto.xml + true + 4096 + false + 1591 + true + false + false + false + 4 + pdbonly + prompt + + + true + + + + + + + + dotnet;uap10.0;net46 + + + + BouncyCastle.snk + + + + + + + + + + + + + \ 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.pcl.csproj b/crypto/crypto.pcl.csproj new file mode 100644 index 000000000..1c3735177 --- /dev/null +++ b/crypto/crypto.pcl.csproj @@ -0,0 +1,106 @@ + + + + Local + 7.10.3077 + 2.0 + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A0} + Debug + AnyCPU + + + crypto + ..\BouncyCastle.snk + JScript + Grid + IE50 + false + Library + crypto + OnBuildSuccess + + + + v4.0 + + + 12.0 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile328 + false + 10.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + bin\pcl\Debug\ + obj\pcl\Debug\ + false + 285212672 + false + + TRACE;DEBUG;PORTABLE;NO_THREADS + doc\pcl\crypto.xml + true + 4096 + false + 1591 + false + false + false + false + 4 + full + prompt + + + bin\pcl\Release\ + obj\pcl\Release\ + false + 285212672 + false + + TRACE;PORTABLE;NO_THREADS + doc\pcl\crypto.xml + true + 4096 + false + 1591 + true + false + false + false + 4 + pdbonly + prompt + + + true + + + + + + + + BouncyCastle.snk + + + + + + + + \ No newline at end of file diff --git a/crypto/crypto.pcl2.csproj b/crypto/crypto.pcl2.csproj new file mode 100644 index 000000000..4edf1139e --- /dev/null +++ b/crypto/crypto.pcl2.csproj @@ -0,0 +1,92 @@ + + + + Local + 7.10.3077 + 2.0 + {38872A5F-E87E-4FAD-B109-8EB7B2E6A4A1} + Debug + AnyCPU + + + crypto + ..\BouncyCastle.snk + JScript + Grid + IE50 + false + Library + crypto + OnBuildSuccess + + v4.5 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile259 + 10.0 + + + + + bin\pcl2\Debug\ + obj\pcl2\Debug\ + false + 285212672 + false + + TRACE;DEBUG;PORTABLE;NO_THREADS;NEW_REFLECTION;SYS_RUNTIME + doc\pcl2\crypto.xml + true + 4096 + false + 1591 + false + false + false + false + 4 + full + prompt + + + bin\pcl2\Release\ + obj\pcl2\Release\ + false + 285212672 + false + + TRACE;PORTABLE;NO_THREADS;NEW_REFLECTION;SYS_RUNTIME + doc\pcl2\crypto.xml + true + 4096 + false + 1591 + true + false + false + false + 4 + pdbonly + prompt + + + true + + + + + + + + + + + + BouncyCastle.snk + + + + + + + + \ No newline at end of file -- cgit 1.4.1 From db1a5bc1bf9d9e9aa5648292c52bbb09eb9ff988 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 21 Nov 2015 19:51:39 +0700 Subject: Refactoring --- crypto/src/AssemblyInfo.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crypto/src/AssemblyInfo.cs b/crypto/src/AssemblyInfo.cs index cfddb17b9..ddf04aa4e 100644 --- a/crypto/src/AssemblyInfo.cs +++ b/crypto/src/AssemblyInfo.cs @@ -82,7 +82,8 @@ using System.Runtime.InteropServices; internal class AssemblyInfo { - private static string version; + private static string version = null; + public static string Version { get @@ -91,13 +92,16 @@ internal class AssemblyInfo { #if PORTABLE #if NEW_REFLECTION - var ver = (AssemblyVersionAttribute)typeof(AssemblyInfo).GetTypeInfo().Assembly.GetCustomAttributes(typeof(AssemblyVersionAttribute)).FirstOrDefault(); + var a = typeof(AssemblyInfo).GetTypeInfo().Assembly; + var c = a.GetCustomAttributes(typeof(AssemblyVersionAttribute)); #else - var ver = (AssemblyVersionAttribute)typeof(AssemblyInfo).Assembly.GetCustomAttributes(typeof(AssemblyVersionAttribute), false).FirstOrDefault(); + var a = typeof(AssemblyInfo).Assembly; + var c = a.GetCustomAttributes(typeof(AssemblyVersionAttribute), false); #endif - if (ver != null) + var v = (AssemblyVersionAttribute)c.FirstOrDefault(); + if (v != null) { - version = ver.Version; + version = v.Version; } #else version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); @@ -105,7 +109,9 @@ internal class AssemblyInfo // if we're still here, then don't try again if (version == null) + { version = string.Empty; + } } return version; -- cgit 1.4.1 From d7e56641a8b11ddd9c8c6457458e2995eeef4371 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 21 Nov 2015 19:53:43 +0700 Subject: Update .gitignore --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index 4162fb347..3b2c97a3b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,21 @@ *.user *.vsp +*.nupkg + Backup/ bin/ dist/ doc/ obj/ + +_Resharper.*/ +_Resharper*/ +*.ide/ +packages/ +.vs/ + +*.nuget.props +*.nuget.targets +*.project.lock.json +project.lock.json -- cgit 1.4.1