From e0f226ac53ec1c9241044dbd67a49c2c9603623a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 14 Oct 2014 14:49:51 -0400 Subject: Added AES, IDEA, and CAST5 CBC S/MIME Capability identifiers --- crypto/src/asn1/smime/SMIMECapabilities.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crypto/src/asn1/smime/SMIMECapabilities.cs b/crypto/src/asn1/smime/SMIMECapabilities.cs index ca3c3af7d..5fb67dde1 100644 --- a/crypto/src/asn1/smime/SMIMECapabilities.cs +++ b/crypto/src/asn1/smime/SMIMECapabilities.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Asn1.Nist; using Org.BouncyCastle.Asn1.Pkcs; using Org.BouncyCastle.Asn1.X509; @@ -25,6 +26,11 @@ namespace Org.BouncyCastle.Asn1.Smime /** * encryption algorithms preferences */ + public static readonly DerObjectIdentifier Aes256Cbc = NistObjectIdentifiers.IdAes256Cbc; + public static readonly DerObjectIdentifier Aes192Cbc = NistObjectIdentifiers.IdAes192Cbc; + public static readonly DerObjectIdentifier Aes128Cbc = NistObjectIdentifiers.IdAes128Cbc; + public static readonly DerObjectIdentifier IdeaCbc = new DerObjectIdentifier("1.3.6.1.4.1.188.7.1.1.2"); + public static readonly DerObjectIdentifier Cast5Cbc = new DerObjectIdentifier("1.2.840.113533.7.66.10"); public static readonly DerObjectIdentifier DesCbc = new DerObjectIdentifier("1.3.14.3.2.7"); public static readonly DerObjectIdentifier DesEde3Cbc = PkcsObjectIdentifiers.DesEde3Cbc; public static readonly DerObjectIdentifier RC2Cbc = PkcsObjectIdentifiers.RC2Cbc; -- cgit 1.5.1 From b7039a1a635e7b74765d44d2caf8cc2c5f66a6bc Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 14 Oct 2014 14:50:29 -0400 Subject: Added Visual Studio 2010 project/solution files for .NET 2.0 and Xamarin Android/iOS --- .gitattributes | 4 +- BouncyCastle.Mobile.sln | 38 + BouncyCastle.sln | 26 + crypto/BouncyCastle.Android.csproj | 1355 +++++++++++++++++++++++ crypto/BouncyCastle.csproj | 1349 ++++++++++++++++++++++ crypto/BouncyCastle.iOS.csproj | 1350 ++++++++++++++++++++++ crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs | 522 ++++----- crypto/test/UnitTests.csproj | 1215 ++++++++++++++++++++ crypto/test/src/util/test/SimpleTest.cs | 14 +- 9 files changed, 5598 insertions(+), 275 deletions(-) create mode 100644 BouncyCastle.Mobile.sln create mode 100644 BouncyCastle.sln create mode 100644 crypto/BouncyCastle.Android.csproj create mode 100644 crypto/BouncyCastle.csproj create mode 100644 crypto/BouncyCastle.iOS.csproj create mode 100644 crypto/test/UnitTests.csproj diff --git a/.gitattributes b/.gitattributes index ba5445104..31e8a5ac4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,7 +5,7 @@ # to native line endings on checkout. *.build text diff=xml *.cs text diff=csharp -*.csproj text diff=xml +*.csproj text diff=xml eol=crlf *.eml text *.html text diff=html *.mdp text diff=xml @@ -13,7 +13,7 @@ *.nunit text diff=xml *.pem text *.README text -*.sln text +*.sln text eol=crlf *.txt text *.xml text diff=xml diff --git a/BouncyCastle.Mobile.sln b/BouncyCastle.Mobile.sln new file mode 100644 index 000000000..0b41d742d --- /dev/null +++ b/BouncyCastle.Mobile.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BouncyCastle", "crypto\BouncyCastle.csproj", "{4C235092-820C-4DEB-9074-D356FB797D8B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BouncyCastle.iOS", "crypto\BouncyCastle.iOS.csproj", "{0249241C-205E-4AC0-828B-90F822359B9E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BouncyCastle.Android", "crypto\BouncyCastle.Android.csproj", "{A0D302CB-8866-4AB1-98B9-F0772EABF5DF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "crypto\test\UnitTests.csproj", "{D4EB669D-7C88-48C0-A480-C5CC73A7369B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0249241C-205E-4AC0-828B-90F822359B9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0249241C-205E-4AC0-828B-90F822359B9E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0249241C-205E-4AC0-828B-90F822359B9E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0249241C-205E-4AC0-828B-90F822359B9E}.Release|Any CPU.Build.0 = Release|Any CPU + {4C235092-820C-4DEB-9074-D356FB797D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C235092-820C-4DEB-9074-D356FB797D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C235092-820C-4DEB-9074-D356FB797D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C235092-820C-4DEB-9074-D356FB797D8B}.Release|Any CPU.Build.0 = Release|Any CPU + {A0D302CB-8866-4AB1-98B9-F0772EABF5DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0D302CB-8866-4AB1-98B9-F0772EABF5DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0D302CB-8866-4AB1-98B9-F0772EABF5DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0D302CB-8866-4AB1-98B9-F0772EABF5DF}.Release|Any CPU.Build.0 = Release|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = crypto\BouncyCastle.csproj + EndGlobalSection +EndGlobal diff --git a/BouncyCastle.sln b/BouncyCastle.sln new file mode 100644 index 000000000..588f3d8ca --- /dev/null +++ b/BouncyCastle.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BouncyCastle", "crypto\BouncyCastle.csproj", "{4C235092-820C-4DEB-9074-D356FB797D8B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "crypto\test\UnitTests.csproj", "{D4EB669D-7C88-48C0-A480-C5CC73A7369B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4C235092-820C-4DEB-9074-D356FB797D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C235092-820C-4DEB-9074-D356FB797D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C235092-820C-4DEB-9074-D356FB797D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C235092-820C-4DEB-9074-D356FB797D8B}.Release|Any CPU.Build.0 = Release|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4EB669D-7C88-48C0-A480-C5CC73A7369B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = crypto\BouncyCastle.csproj + EndGlobalSection +EndGlobal diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj new file mode 100644 index 000000000..de74d5999 --- /dev/null +++ b/crypto/BouncyCastle.Android.csproj @@ -0,0 +1,1355 @@ + + + + Debug + AnyCPU + 10.0.0 + 2.0 + {A0D302CB-8866-4AB1-98B9-F0772EABF5DF} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Org.BouncyCastle + Resources + Assets + False + BouncyCastle + v2.3 + + + true + full + false + bin\Debug\lib\MonoAndroid + obj\Debug\lib\MonoAndroid + DEBUG;TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__ANDROID__; + prompt + 4 + None + false + + + full + true + bin\Release\lib\MonoAndroid + obj\Release\lib\MonoAndroid + TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__ANDROID__; + prompt + 4 + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj new file mode 100644 index 000000000..86c57df0c --- /dev/null +++ b/crypto/BouncyCastle.csproj @@ -0,0 +1,1349 @@ + + + + Debug + AnyCPU + 10.0.0 + 2.0 + {4C235092-820C-4DEB-9074-D356FB797D8B} + Library + Org.BouncyCastle + BouncyCastle + v2.0 + + + true + full + false + bin\Debug\lib\net20 + obj\Debug\lib\net20 + DEBUG;TRACE;INCLUDE_IDEA;STRONG_NAME + prompt + 4 + false + + + true + bin\Release\lib\net20 + obj\Release\lib\net20 + TRACE;INCLUDE_IDEA;STRONG_NAME + doc\BouncyCastle.xml + prompt + 4 + false + 1591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj new file mode 100644 index 000000000..cc3de9e55 --- /dev/null +++ b/crypto/BouncyCastle.iOS.csproj @@ -0,0 +1,1350 @@ + + + + Debug + AnyCPU + 10.0.0 + 2.0 + {0249241C-205E-4AC0-828B-90F822359B9E} + {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Org.BouncyCastle + Resources + BouncyCastle + + + true + full + false + bin\Debug\lib\MonoTouch + obj\Debug\lib\MonoTouch + DEBUG;TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__IOS__; + prompt + 4 + false + + + true + bin\Release\lib\MonoTouch + obj\Release\lib\MonoTouch + TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__IOS__; + prompt + 4 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs b/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs index 64b5dbec8..dc473ee08 100644 --- a/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs +++ b/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs @@ -1,277 +1,277 @@ -using System; +using System; using Org.BouncyCastle.Asn1.X509; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { - /** - * Attribute to indicate admissions to certain professions. - *

- *

-    *     AdmissionSyntax ::= SEQUENCE
-    *     {
-    *       admissionAuthority GeneralName OPTIONAL,
-    *       contentsOfAdmissions SEQUENCE OF Admissions
-    *     }
-    * 

- * Admissions ::= SEQUENCE - * { - * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL - * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL - * professionInfos SEQUENCE OF ProfessionInfo - * } - *

- * NamingAuthority ::= SEQUENCE - * { - * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, - * namingAuthorityUrl IA5String OPTIONAL, - * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL - * } - *

- * ProfessionInfo ::= SEQUENCE - * { - * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, - * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), - * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, - * addProfessionInfo OCTET STRING OPTIONAL - * } - *

- *

- *

- * ISIS-MTT PROFILE: The relatively complex structure of AdmissionSyntax - * supports the following concepts and requirements: - *

- *

- * By means of different namingAuthority-OIDs or profession OIDs hierarchies of - * professions, specializations, disciplines, fields of activity, etc. can be - * expressed. The issuing admission authority should always be indicated (field - * admissionAuthority), whenever a registration number is presented. Still, - * information on admissions can be given without indicating an admission or a - * naming authority by the exclusive use of the component professionItems. In - * this case the certification authority is responsible for the verification of - * the admission information. - *

- *

- *

- * This attribute is single-valued. Still, several admissions can be captured in - * the sequence structure of the component contentsOfAdmissions of - * AdmissionSyntax or in the component professionInfos of Admissions. The - * component admissionAuthority of AdmissionSyntax serves as default value for - * the component admissionAuthority of Admissions. Within the latter component - * the default value can be overwritten, in case that another authority is - * responsible. The component namingAuthority of Admissions serves as a default - * value for the component namingAuthority of ProfessionInfo. Within the latter - * component the default value can be overwritten, in case that another naming - * authority needs to be recorded. - *

- * The length of the string objects is limited to 128 characters. It is - * recommended to indicate a namingAuthorityURL in all issued attribute - * certificates. If a namingAuthorityURL is indicated, the field professionItems - * of ProfessionInfo should contain only registered titles. If the field - * professionOIDs exists, it has to contain the OIDs of the professions listed - * in professionItems in the same order. In general, the field professionInfos - * should contain only one entry, unless the admissions that are to be listed - * are logically connected (e.g. they have been issued under the same admission - * number). - * - * @see Org.BouncyCastle.Asn1.IsisMtt.X509.Admissions - * @see Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo - * @see Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority - */ - public class AdmissionSyntax - : Asn1Encodable - { - private readonly GeneralName admissionAuthority; - private readonly Asn1Sequence contentsOfAdmissions; + /** + * Attribute to indicate admissions to certain professions. + *

+ *

+	*     AdmissionSyntax ::= SEQUENCE
+	*     {
+	*       admissionAuthority GeneralName OPTIONAL,
+	*       contentsOfAdmissions SEQUENCE OF Admissions
+	*     }
+	* 

+ * Admissions ::= SEQUENCE + * { + * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + * professionInfos SEQUENCE OF ProfessionInfo + * } + *

+ * NamingAuthority ::= SEQUENCE + * { + * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + * namingAuthorityUrl IA5String OPTIONAL, + * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + * } + *

+ * ProfessionInfo ::= SEQUENCE + * { + * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + * addProfessionInfo OCTET STRING OPTIONAL + * } + *

+ *

+ *

+ * ISIS-MTT PROFILE: The relatively complex structure of AdmissionSyntax + * supports the following concepts and requirements: + *

+ *

+ * By means of different namingAuthority-OIDs or profession OIDs hierarchies of + * professions, specializations, disciplines, fields of activity, etc. can be + * expressed. The issuing admission authority should always be indicated (field + * admissionAuthority), whenever a registration number is presented. Still, + * information on admissions can be given without indicating an admission or a + * naming authority by the exclusive use of the component professionItems. In + * this case the certification authority is responsible for the verification of + * the admission information. + *

+ *

+ *

+ * This attribute is single-valued. Still, several admissions can be captured in + * the sequence structure of the component contentsOfAdmissions of + * AdmissionSyntax or in the component professionInfos of Admissions. The + * component admissionAuthority of AdmissionSyntax serves as default value for + * the component admissionAuthority of Admissions. Within the latter component + * the default value can be overwritten, in case that another authority is + * responsible. The component namingAuthority of Admissions serves as a default + * value for the component namingAuthority of ProfessionInfo. Within the latter + * component the default value can be overwritten, in case that another naming + * authority needs to be recorded. + *

+ * The length of the string objects is limited to 128 characters. It is + * recommended to indicate a namingAuthorityURL in all issued attribute + * certificates. If a namingAuthorityURL is indicated, the field professionItems + * of ProfessionInfo should contain only registered titles. If the field + * professionOIDs exists, it has to contain the OIDs of the professions listed + * in professionItems in the same order. In general, the field professionInfos + * should contain only one entry, unless the admissions that are to be listed + * are logically connected (e.g. they have been issued under the same admission + * number). + * + * @see Org.BouncyCastle.Asn1.IsisMtt.X509.Admissions + * @see Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo + * @see Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority + */ + public class AdmissionSyntax + : Asn1Encodable + { + private readonly GeneralName admissionAuthority; + private readonly Asn1Sequence contentsOfAdmissions; - public static AdmissionSyntax GetInstance( - object obj) - { - if (obj == null || obj is AdmissionSyntax) - { - return (AdmissionSyntax)obj; - } + public static AdmissionSyntax GetInstance( + object obj) + { + if (obj == null || obj is AdmissionSyntax) + { + return (AdmissionSyntax) obj; + } - if (obj is Asn1Sequence) - { - return new AdmissionSyntax((Asn1Sequence)obj); - } + if (obj is Asn1Sequence) + { + return new AdmissionSyntax((Asn1Sequence) obj); + } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); - } + throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + } - /** - * Constructor from Asn1Sequence. - *

- * The sequence is of type ProcurationSyntax: - *

- *

-        *     AdmissionSyntax ::= SEQUENCE
-        *     {
-        *       admissionAuthority GeneralName OPTIONAL,
-        *       contentsOfAdmissions SEQUENCE OF Admissions
-        *     }
-        * 

- * Admissions ::= SEQUENCE - * { - * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL - * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL - * professionInfos SEQUENCE OF ProfessionInfo - * } - *

- * NamingAuthority ::= SEQUENCE - * { - * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, - * namingAuthorityUrl IA5String OPTIONAL, - * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL - * } - *

- * ProfessionInfo ::= SEQUENCE - * { - * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, - * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), - * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, - * addProfessionInfo OCTET STRING OPTIONAL - * } - *

- * - * @param seq The ASN.1 sequence. - */ - private AdmissionSyntax( - Asn1Sequence seq) - { - switch (seq.Count) - { - case 1: - this.contentsOfAdmissions = DerSequence.GetInstance(seq[0]); - break; - case 2: - admissionAuthority = GeneralName.GetInstance(seq[0]); - contentsOfAdmissions = DerSequence.GetInstance(seq[1]); - break; - default: - throw new ArgumentException("Bad sequence size: " + seq.Count); - } - } + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type ProcurationSyntax: + *

+ *

+		*     AdmissionSyntax ::= SEQUENCE
+		*     {
+		*       admissionAuthority GeneralName OPTIONAL,
+		*       contentsOfAdmissions SEQUENCE OF Admissions
+		*     }
+		* 

+ * Admissions ::= SEQUENCE + * { + * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + * professionInfos SEQUENCE OF ProfessionInfo + * } + *

+ * NamingAuthority ::= SEQUENCE + * { + * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + * namingAuthorityUrl IA5String OPTIONAL, + * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + * } + *

+ * ProfessionInfo ::= SEQUENCE + * { + * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + * addProfessionInfo OCTET STRING OPTIONAL + * } + *

+ * + * @param seq The ASN.1 sequence. + */ + private AdmissionSyntax( + Asn1Sequence seq) + { + switch (seq.Count) + { + case 1: + this.contentsOfAdmissions = DerSequence.GetInstance(seq[0]); + break; + case 2: + admissionAuthority = GeneralName.GetInstance(seq[0]); + contentsOfAdmissions = DerSequence.GetInstance(seq[1]); + break; + default: + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + } - /** - * Constructor from given details. - * - * @param admissionAuthority The admission authority. - * @param contentsOfAdmissions The admissions. - */ - public AdmissionSyntax( - GeneralName admissionAuthority, - Asn1Sequence contentsOfAdmissions) - { - this.admissionAuthority = admissionAuthority; - this.contentsOfAdmissions = contentsOfAdmissions; - } + /** + * Constructor from given details. + * + * @param admissionAuthority The admission authority. + * @param contentsOfAdmissions The admissions. + */ + public AdmissionSyntax( + GeneralName admissionAuthority, + Asn1Sequence contentsOfAdmissions) + { + this.admissionAuthority = admissionAuthority; + this.contentsOfAdmissions = contentsOfAdmissions; + } - /** - * Produce an object suitable for an Asn1OutputStream. - *

- * Returns: - *

- *

-        *     AdmissionSyntax ::= SEQUENCE
-        *     {
-        *       admissionAuthority GeneralName OPTIONAL,
-        *       contentsOfAdmissions SEQUENCE OF Admissions
-        *     }
-        * 

- * Admissions ::= SEQUENCE - * { - * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL - * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL - * professionInfos SEQUENCE OF ProfessionInfo - * } - *

- * NamingAuthority ::= SEQUENCE - * { - * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, - * namingAuthorityUrl IA5String OPTIONAL, - * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL - * } - *

- * ProfessionInfo ::= SEQUENCE - * { - * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, - * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), - * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, - * addProfessionInfo OCTET STRING OPTIONAL - * } - *

- * - * @return an Asn1Object - */ - public override Asn1Object ToAsn1Object() - { - Asn1EncodableVector vec = new Asn1EncodableVector(); - if (admissionAuthority != null) - { - vec.Add(admissionAuthority); - } - vec.Add(contentsOfAdmissions); - return new DerSequence(vec); - } + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*     AdmissionSyntax ::= SEQUENCE
+		*     {
+		*       admissionAuthority GeneralName OPTIONAL,
+		*       contentsOfAdmissions SEQUENCE OF Admissions
+		*     }
+		* 

+ * Admissions ::= SEQUENCE + * { + * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + * professionInfos SEQUENCE OF ProfessionInfo + * } + *

+ * NamingAuthority ::= SEQUENCE + * { + * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + * namingAuthorityUrl IA5String OPTIONAL, + * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + * } + *

+ * ProfessionInfo ::= SEQUENCE + * { + * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + * addProfessionInfo OCTET STRING OPTIONAL + * } + *

+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + if (admissionAuthority != null) + { + vec.Add(admissionAuthority); + } + vec.Add(contentsOfAdmissions); + return new DerSequence(vec); + } - /** - * @return Returns the admissionAuthority if present, null otherwise. - */ - public virtual GeneralName AdmissionAuthority - { - get { return admissionAuthority; } - } + /** + * @return Returns the admissionAuthority if present, null otherwise. + */ + public virtual GeneralName AdmissionAuthority + { + get { return admissionAuthority; } + } - /** - * @return Returns the contentsOfAdmissions. - */ - public virtual Admissions[] GetContentsOfAdmissions() - { - Admissions[] result = new Admissions[contentsOfAdmissions.Count]; + /** + * @return Returns the contentsOfAdmissions. + */ + public virtual Admissions[] GetContentsOfAdmissions() + { + Admissions[] result = new Admissions[contentsOfAdmissions.Count]; - for (int i = 0; i < contentsOfAdmissions.Count; ++i) - { - result[i] = Admissions.GetInstance(contentsOfAdmissions[i]); - } + for (int i = 0; i < contentsOfAdmissions.Count; ++i) + { + result[i] = Admissions.GetInstance(contentsOfAdmissions[i]); + } - return result; - } - } + return result; + } + } } diff --git a/crypto/test/UnitTests.csproj b/crypto/test/UnitTests.csproj new file mode 100644 index 000000000..59cff41e1 --- /dev/null +++ b/crypto/test/UnitTests.csproj @@ -0,0 +1,1215 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {D4EB669D-7C88-48C0-A480-C5CC73A7369B} + Library + UnitTests + UnitTests + v2.0 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + 219 + + + full + true + bin\Release + prompt + 4 + false + 219 + + + + + lib\nunit.framework.dll + + + lib\nunit.core.interfaces.dll + + + lib\nunit.core.dll + + + + + + {4C235092-820C-4DEB-9074-D356FB797D8B} + BouncyCastle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crypto/test/src/util/test/SimpleTest.cs b/crypto/test/src/util/test/SimpleTest.cs index be846e20f..bcbfa2a5b 100644 --- a/crypto/test/src/util/test/SimpleTest.cs +++ b/crypto/test/src/util/test/SimpleTest.cs @@ -115,23 +115,13 @@ namespace Org.BouncyCastle.Utilities.Test private static string GetFullName( string name) { -// TODO MonoDevelop/Visual Studio embedded resource ids still inconsistent -#if BC_BUILD_MONODEVELOP - return "test.data." + name; -#else - return "crypto.test.data." + name; -#endif + return "UnitTests.data." + name; } private static string GetShortName( string fullName) { -// TODO MonoDevelop/Visual Studio embedded resource ids still inconsistent -#if BC_BUILD_MONODEVELOP - return fullName.Substring("test.data.".Length); -#else - return fullName.Substring("crypto.test.data.".Length); -#endif + return fullName.Substring("UnitTests.data.".Length); } #if NETCF_1_0 || NETCF_2_0 -- cgit 1.5.1 From 32f3459c02f3175f843359a71e085ba0f528e850 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 23 Nov 2014 10:21:30 -0500 Subject: Updated Visual Studio 2010 project files --- crypto/BouncyCastle.Android.csproj | 11 +++++++++++ crypto/BouncyCastle.csproj | 11 +++++++++++ crypto/BouncyCastle.iOS.csproj | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index de74d5999..7c4c243fb 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -908,6 +908,7 @@ + @@ -917,6 +918,16 @@ + + + + + + + + + + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index 86c57df0c..c7199a1bc 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -902,6 +902,7 @@ + @@ -911,6 +912,16 @@ + + + + + + + + + + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index cc3de9e55..0dcb9c9af 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -902,6 +902,7 @@ + @@ -911,6 +912,16 @@ + + + + + + + + + + -- cgit 1.5.1 From cdf44b85a4eecc5ec6ff78d27ab6ded7ace90573 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 23 Nov 2014 10:22:45 -0500 Subject: Added BouncyCastle.snk --- BouncyCastle.snk | Bin 0 -> 596 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 BouncyCastle.snk diff --git a/BouncyCastle.snk b/BouncyCastle.snk new file mode 100644 index 000000000..5f2a49647 Binary files /dev/null and b/BouncyCastle.snk differ -- cgit 1.5.1 From 637cb4525968593634b7cc6d3f93ffc38e37f5da Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 17 Jan 2015 11:54:11 -0500 Subject: Migrated the iOS project to the Xamarin.iOS Unified API (for 64-bit support) --- crypto/BouncyCastle.iOS.csproj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 0dcb9c9af..e57417cdc 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -6,11 +6,13 @@ 10.0.0 2.0 {0249241C-205E-4AC0-828B-90F822359B9E} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library Org.BouncyCastle Resources BouncyCastle + Xamarin.iOS + v1.0 true @@ -36,7 +38,7 @@ - + @@ -1357,5 +1359,5 @@ - + -- cgit 1.5.1 From 32fc8945c1a210c430ec323e25add02ea953008f Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 18 Jan 2015 17:37:52 -0500 Subject: Cleaned up the new iOS project file --- crypto/BouncyCastle.iOS.csproj | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index e57417cdc..35d8f495f 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -12,14 +12,13 @@ Resources BouncyCastle Xamarin.iOS - v1.0 true full false - bin\Debug\lib\MonoTouch - obj\Debug\lib\MonoTouch + bin\Debug\lib\Xamarin.iOS + obj\Debug\lib\Xamarin.iOS DEBUG;TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__IOS__; prompt 4 @@ -27,8 +26,8 @@ true - bin\Release\lib\MonoTouch - obj\Release\lib\MonoTouch + bin\Release\lib\Xamarin.iOS + obj\Release\lib\Xamarin.iOS TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__IOS__; prompt 4 -- cgit 1.5.1 From 440edd8dd1b167e43a0e531dc26204dca42488b5 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 17 Feb 2015 09:48:01 -0500 Subject: Added TlsPskIdentityManager.cs to the build --- crypto/BouncyCastle.Android.csproj | 1 + crypto/BouncyCastle.csproj | 1 + crypto/BouncyCastle.iOS.csproj | 1 + 3 files changed, 3 insertions(+) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 7c4c243fb..db03b75be 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -1001,6 +1001,7 @@ + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index c7199a1bc..1a43de126 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -995,6 +995,7 @@ + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 35d8f495f..45a7dfaab 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -996,6 +996,7 @@ + -- cgit 1.5.1 From b0db8810e52d60d2adfe98a495351052c87616a1 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 28 Mar 2015 11:49:37 -0400 Subject: Updated Visual Studio 2010 project files --- crypto/BouncyCastle.Android.csproj | 104 +++++++++++++++++++++++++++++------- crypto/BouncyCastle.csproj | 104 +++++++++++++++++++++++++++++------- crypto/BouncyCastle.iOS.csproj | 105 ++++++++++++++++++++++++++++++------- 3 files changed, 255 insertions(+), 58 deletions(-) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 8a201b824..05eef369d 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - 10.0.0 + 8.0.30703 2.0 {A0D302CB-8866-4AB1-98B9-F0772EABF5DF} {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -129,6 +129,8 @@ + + @@ -667,6 +669,7 @@ + @@ -676,7 +679,6 @@ - @@ -766,8 +768,8 @@ - + @@ -904,7 +906,7 @@ - + @@ -951,8 +953,8 @@ - + @@ -996,10 +998,10 @@ - + @@ -1035,8 +1037,8 @@ - + @@ -1045,8 +1047,6 @@ - - @@ -1056,11 +1056,20 @@ - - - - - + + + + + + + + + + + + + + @@ -1093,6 +1102,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1125,6 +1182,19 @@ + + + + + + + + + + + + + @@ -1368,14 +1438,10 @@ - - - - - + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index ee05e159a..668648ccc 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - 10.0.0 + 8.0.30703 2.0 {4C235092-820C-4DEB-9074-D356FB797D8B} Library @@ -123,6 +123,8 @@ + + @@ -661,6 +663,7 @@ + @@ -670,7 +673,6 @@ - @@ -760,8 +762,8 @@ - + @@ -898,7 +900,7 @@ - + @@ -945,8 +947,8 @@ - + @@ -990,10 +992,10 @@ - + @@ -1029,8 +1031,8 @@ - + @@ -1039,8 +1041,6 @@ - - @@ -1050,11 +1050,20 @@ - - - - - + + + + + + + + + + + + + + @@ -1087,6 +1096,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1119,6 +1176,19 @@ + + + + + + + + + + + + + @@ -1362,14 +1432,10 @@ - - - - - + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 7e6830fe6..372153436 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - 10.0.0 + 8.0.30703 2.0 {0249241C-205E-4AC0-828B-90F822359B9E} {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -124,6 +124,8 @@ + + @@ -662,6 +664,7 @@ + @@ -671,7 +674,6 @@ - @@ -761,8 +763,8 @@ - + @@ -899,7 +901,7 @@ - + @@ -946,8 +948,8 @@ - + @@ -991,10 +993,10 @@ - + @@ -1030,8 +1032,8 @@ - + @@ -1040,8 +1042,6 @@ - - @@ -1051,11 +1051,20 @@ - - - - - + + + + + + + + + + + + + + @@ -1088,6 +1097,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1120,6 +1177,19 @@ + + + + + + + + + + + + + @@ -1363,15 +1433,10 @@ - - - - - - + -- cgit 1.5.1 From 14d36be3439b7a93ab97ec4f61f08236ee00b2ad Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 11 Apr 2015 17:30:14 +0700 Subject: Remove overly strict check on ECC extensions --- crypto/src/crypto/tls/AbstractTlsServer.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crypto/src/crypto/tls/AbstractTlsServer.cs b/crypto/src/crypto/tls/AbstractTlsServer.cs index c3e250fd8..9f549cfd1 100644 --- a/crypto/src/crypto/tls/AbstractTlsServer.cs +++ b/crypto/src/crypto/tls/AbstractTlsServer.cs @@ -165,9 +165,13 @@ namespace Org.BouncyCastle.Crypto.Tls /* * RFC 4429 4. The client MUST NOT include these extensions in the ClientHello message if it * does not propose any ECC cipher suites. + * + * NOTE: This was overly strict as there may be ECC cipher suites that we don't recognize. + * Also, draft-ietf-tls-negotiated-ff-dhe will be overloading the 'elliptic_curves' + * extension to explicitly allow FFDHE (i.e. non-ECC) groups. */ - if (!this.mEccCipherSuitesOffered && (this.mNamedCurves != null || this.mClientECPointFormats != null)) - throw new TlsFatalAlert(AlertDescription.illegal_parameter); + //if (!this.mEccCipherSuitesOffered && (this.mNamedCurves != null || this.mClientECPointFormats != null)) + // throw new TlsFatalAlert(AlertDescription.illegal_parameter); } public virtual ProtocolVersion GetServerVersion() -- cgit 1.5.1 From 3ce61b5ebe84b928e1c067c0e2d5b0e53f834137 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 18 Apr 2015 21:22:01 +0700 Subject: Port recent Java updates --- crypto/BouncyCastle.Android.csproj | 4 ++ crypto/BouncyCastle.csproj | 4 ++ crypto/BouncyCastle.iOS.csproj | 4 ++ crypto/crypto.csproj | 20 ++++++ crypto/src/bcpg/ECDHPublicBCPGKey.cs | 102 ++++++++++++++++++++++++++++++ crypto/src/bcpg/ECDsaPublicBCPGKey.cs | 34 ++++++++++ crypto/src/bcpg/ECPublicBCPGKey.cs | 97 ++++++++++++++++++++++++++++ crypto/src/bcpg/ECSecretBCPGKey.cs | 56 ++++++++++++++++ crypto/src/bcpg/PublicKeyPacket.cs | 6 ++ crypto/src/bcpg/SignaturePacket.cs | 5 ++ crypto/src/crypto/modes/CcmBlockCipher.cs | 11 ++-- crypto/src/openpgp/PgpPublicKey.cs | 5 ++ 12 files changed, 343 insertions(+), 5 deletions(-) create mode 100644 crypto/src/bcpg/ECDHPublicBCPGKey.cs create mode 100644 crypto/src/bcpg/ECDsaPublicBCPGKey.cs create mode 100644 crypto/src/bcpg/ECPublicBCPGKey.cs create mode 100644 crypto/src/bcpg/ECSecretBCPGKey.cs diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 05eef369d..51f7f19a2 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -486,6 +486,10 @@ + + + + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index 668648ccc..117af8d95 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -480,6 +480,10 @@ + + + + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 372153436..a1d3b15a1 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -481,6 +481,10 @@ + + + + diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj index cb00f9912..0a0e2c1da 100644 --- a/crypto/crypto.csproj +++ b/crypto/crypto.csproj @@ -2323,6 +2323,26 @@ SubType = "Code" BuildAction = "Compile" /> + + + + Base class for an ECDH Public Key. + public class ECDHPublicBcpgKey + : ECPublicBcpgKey + { + private byte reserved; + private byte hashFunctionId; + private byte symAlgorithmId; + + /// The stream to read the packet from. + public ECDHPublicBcpgKey( + BcpgInputStream bcpgIn) + : base(bcpgIn) + { + int length = bcpgIn.ReadByte(); + byte[] kdfParameters = new byte[length]; + if (kdfParameters.Length != 3) + throw new InvalidOperationException("kdf parameters size of 3 expected."); + + bcpgIn.ReadFully(kdfParameters); + + reserved = kdfParameters[0]; + hashFunctionId = kdfParameters[1]; + symAlgorithmId = kdfParameters[2]; + + VerifyHashAlgorithm(); + VerifySymmetricKeyAlgorithm(); + } + + public ECDHPublicBcpgKey( + DerObjectIdentifier oid, + ECPoint point, + int hashAlgorithm, + int symmetricKeyAlgorithm) + : base(oid, point) + { + reserved = 1; + hashFunctionId = (byte)hashAlgorithm; + symAlgorithmId = (byte)symmetricKeyAlgorithm; + + VerifyHashAlgorithm(); + VerifySymmetricKeyAlgorithm(); + } + + public virtual byte Reserved + { + get { return reserved; } + } + + public virtual byte HashAlgorithm + { + get { return hashFunctionId; } + } + + public virtual byte SymmetricKeyAlgorithm + { + get { return symAlgorithmId; } + } + + public override void Encode( + BcpgOutputStream bcpgOut) + { + base.Encode(bcpgOut); + bcpgOut.WriteByte(0x3); + bcpgOut.WriteByte(reserved); + bcpgOut.WriteByte(hashFunctionId); + bcpgOut.WriteByte(symAlgorithmId); + } + + private void VerifyHashAlgorithm() + { + switch ((HashAlgorithmTag)hashFunctionId) + { + case HashAlgorithmTag.Sha256: + case HashAlgorithmTag.Sha384: + case HashAlgorithmTag.Sha512: + break; + default: + throw new InvalidOperationException("Hash algorithm must be SHA-256 or stronger."); + } + } + + private void VerifySymmetricKeyAlgorithm() + { + switch ((SymmetricKeyAlgorithmTag)symAlgorithmId) + { + case SymmetricKeyAlgorithmTag.Aes128: + case SymmetricKeyAlgorithmTag.Aes192: + case SymmetricKeyAlgorithmTag.Aes256: + break; + default: + throw new InvalidOperationException("Symmetric key algorithm must be AES-128 or stronger."); + } + } + } +} diff --git a/crypto/src/bcpg/ECDsaPublicBCPGKey.cs b/crypto/src/bcpg/ECDsaPublicBCPGKey.cs new file mode 100644 index 000000000..5f0c8ac55 --- /dev/null +++ b/crypto/src/bcpg/ECDsaPublicBCPGKey.cs @@ -0,0 +1,34 @@ +using System; + +using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Math; +using Org.BouncyCastle.Math.EC; + +namespace Org.BouncyCastle.Bcpg +{ + /// Base class for an ECDSA Public Key. + public class ECDsaPublicBcpgKey + : ECPublicBcpgKey + { + /// The stream to read the packet from. + protected internal ECDsaPublicBcpgKey( + BcpgInputStream bcpgIn) + : base(bcpgIn) + { + } + + public ECDsaPublicBcpgKey( + DerObjectIdentifier oid, + ECPoint point) + : base(oid, point) + { + } + + public ECDsaPublicBcpgKey( + DerObjectIdentifier oid, + BigInteger encodedPoint) + : base(oid, encodedPoint) + { + } + } +} diff --git a/crypto/src/bcpg/ECPublicBCPGKey.cs b/crypto/src/bcpg/ECPublicBCPGKey.cs new file mode 100644 index 000000000..f328f9dc3 --- /dev/null +++ b/crypto/src/bcpg/ECPublicBCPGKey.cs @@ -0,0 +1,97 @@ +using System; +using System.IO; + +using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Math; +using Org.BouncyCastle.Math.EC; + +namespace Org.BouncyCastle.Bcpg +{ + /// Base class for an EC Public Key. + public abstract class ECPublicBcpgKey + : BcpgObject, IBcpgKey + { + internal DerObjectIdentifier oid; + internal BigInteger point; + + /// The stream to read the packet from. + protected ECPublicBcpgKey( + BcpgInputStream bcpgIn) + { + this.oid = DerObjectIdentifier.GetInstance(Asn1Object.FromByteArray(ReadBytesOfEncodedLength(bcpgIn))); + this.point = new MPInteger(bcpgIn).Value; + } + + protected ECPublicBcpgKey( + DerObjectIdentifier oid, + ECPoint point) + { + this.point = new BigInteger(1, point.GetEncoded()); + this.oid = oid; + } + + protected ECPublicBcpgKey( + DerObjectIdentifier oid, + BigInteger encodedPoint) + { + this.point = encodedPoint; + this.oid = oid; + } + + /// The format, as a string, always "PGP". + public string Format + { + get { return "PGP"; } + } + + /// Return the standard PGP encoding of the key. + public override byte[] GetEncoded() + { + try + { + return base.GetEncoded(); + } + catch (IOException) + { + return null; + } + } + + public override void Encode( + BcpgOutputStream bcpgOut) + { + byte[] oid = this.oid.GetEncoded(); + bcpgOut.Write(oid, 1, oid.Length - 1); + + MPInteger point = new MPInteger(this.point); + bcpgOut.WriteObject(point); + } + + public virtual BigInteger EncodedPoint + { + get { return point; } + } + + public virtual DerObjectIdentifier CurveOid + { + get { return oid; } + } + + protected static byte[] ReadBytesOfEncodedLength( + BcpgInputStream bcpgIn) + { + int length = bcpgIn.ReadByte(); + if (length == 0 || length == 0xFF) + { + throw new IOException("future extensions not yet implemented."); + } + + byte[] buffer = new byte[length + 2]; + bcpgIn.ReadFully(buffer, 2, buffer.Length - 2); + buffer[0] = (byte)0x06; + buffer[1] = (byte)length; + + return buffer; + } + } +} diff --git a/crypto/src/bcpg/ECSecretBCPGKey.cs b/crypto/src/bcpg/ECSecretBCPGKey.cs new file mode 100644 index 000000000..22e0a3473 --- /dev/null +++ b/crypto/src/bcpg/ECSecretBCPGKey.cs @@ -0,0 +1,56 @@ +using System; + +using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Math; + +namespace Org.BouncyCastle.Bcpg +{ + /// Base class for an EC Secret Key. + public class ECSecretBcpgKey + : BcpgObject, IBcpgKey + { + internal MPInteger x; + + public ECSecretBcpgKey( + BcpgInputStream bcpgIn) + { + this.x = new MPInteger(bcpgIn); + } + + public ECSecretBcpgKey( + BigInteger x) + { + this.x = new MPInteger(x); + } + + /// The format, as a string, always "PGP". + public string Format + { + get { return "PGP"; } + } + + /// Return the standard PGP encoding of the key. + public override byte[] GetEncoded() + { + try + { + return base.GetEncoded(); + } + catch (Exception) + { + return null; + } + } + + public override void Encode( + BcpgOutputStream bcpgOut) + { + bcpgOut.WriteObject(x); + } + + public virtual BigInteger X + { + get { return x.Value; } + } + } +} diff --git a/crypto/src/bcpg/PublicKeyPacket.cs b/crypto/src/bcpg/PublicKeyPacket.cs index a45aeb469..cea5c8ed2 100644 --- a/crypto/src/bcpg/PublicKeyPacket.cs +++ b/crypto/src/bcpg/PublicKeyPacket.cs @@ -44,6 +44,12 @@ namespace Org.BouncyCastle.Bcpg case PublicKeyAlgorithmTag.ElGamalGeneral: key = new ElGamalPublicBcpgKey(bcpgIn); break; + case PublicKeyAlgorithmTag.EC: + key = new ECDHPublicBcpgKey(bcpgIn); + break; + case PublicKeyAlgorithmTag.ECDsa: + key = new ECDsaPublicBcpgKey(bcpgIn); + break; default: throw new IOException("unknown PGP public key algorithm encountered"); } diff --git a/crypto/src/bcpg/SignaturePacket.cs b/crypto/src/bcpg/SignaturePacket.cs index 605ce84c4..5b91c15a3 100644 --- a/crypto/src/bcpg/SignaturePacket.cs +++ b/crypto/src/bcpg/SignaturePacket.cs @@ -146,6 +146,11 @@ namespace Org.BouncyCastle.Bcpg MPInteger y = new MPInteger(bcpgIn); signature = new MPInteger[]{ p, g, y }; break; + case PublicKeyAlgorithmTag.ECDsa: + MPInteger ecR = new MPInteger(bcpgIn); + MPInteger ecS = new MPInteger(bcpgIn); + signature = new MPInteger[]{ ecR, ecS }; + break; default: if (keyAlgorithm >= PublicKeyAlgorithmTag.Experimental_1 && keyAlgorithm <= PublicKeyAlgorithmTag.Experimental_11) { diff --git a/crypto/src/crypto/modes/CcmBlockCipher.cs b/crypto/src/crypto/modes/CcmBlockCipher.cs index e0b1e6b54..19e273d7c 100644 --- a/crypto/src/crypto/modes/CcmBlockCipher.cs +++ b/crypto/src/crypto/modes/CcmBlockCipher.cs @@ -268,9 +268,10 @@ namespace Org.BouncyCastle.Crypto.Modes outputLen = inLen + macSize; Check.OutputLength(output, outOff, outputLen, "Output buffer too short."); - calculateMac(input, inOff, inLen, macBlock); + CalculateMac(input, inOff, inLen, macBlock); - ctrCipher.ProcessBlock(macBlock, 0, macBlock, 0); // S0 + byte[] encMac = new byte[BlockSize]; + ctrCipher.ProcessBlock(macBlock, 0, encMac, 0); // S0 while (inIndex < (inOff + inLen - BlockSize)) // S1... { @@ -287,7 +288,7 @@ namespace Org.BouncyCastle.Crypto.Modes Array.Copy(block, 0, output, outIndex, inLen + inOff - inIndex); - Array.Copy(macBlock, 0, output, outOff + inLen, macSize); + Array.Copy(encMac, 0, output, outOff + inLen, macSize); } else { @@ -323,7 +324,7 @@ namespace Org.BouncyCastle.Crypto.Modes byte[] calculatedMacBlock = new byte[BlockSize]; - calculateMac(output, outOff, outputLen, calculatedMacBlock); + CalculateMac(output, outOff, outputLen, calculatedMacBlock); if (!Arrays.ConstantTimeAreEqual(macBlock, calculatedMacBlock)) throw new InvalidCipherTextException("mac check in CCM failed"); @@ -332,7 +333,7 @@ namespace Org.BouncyCastle.Crypto.Modes return outputLen; } - private int calculateMac(byte[] data, int dataOff, int dataLen, byte[] macBlock) + private int CalculateMac(byte[] data, int dataOff, int dataLen, byte[] macBlock) { IMac cMac = new CbcBlockCipherMac(cipher, macSize * 8); diff --git a/crypto/src/openpgp/PgpPublicKey.cs b/crypto/src/openpgp/PgpPublicKey.cs index 249b94ea6..5bde2c8fe 100644 --- a/crypto/src/openpgp/PgpPublicKey.cs +++ b/crypto/src/openpgp/PgpPublicKey.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.IO; +using Org.BouncyCastle.Asn1.X9; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.IO; using Org.BouncyCastle.Crypto.Parameters; @@ -104,6 +105,10 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp { this.keyStrength = ((ElGamalPublicBcpgKey)key).P.BitLength; } + else if (key is ECPublicBcpgKey) + { + this.keyStrength = ECNamedCurveTable.GetByOid(((ECPublicBcpgKey)key).CurveOid).Curve.FieldSize; + } } } -- cgit 1.5.1 From bb1849f93d2872dce69a5141a55061da1b9b9562 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 16 Jun 2015 16:45:17 -0400 Subject: Bumped minimum Android version to 4.0.3 (was: 2.3.3) --- crypto/BouncyCastle.Android.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 51f7f19a2..e5000145b 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -13,7 +13,7 @@ Assets False BouncyCastle - v2.3 + v4.0.3 true -- cgit 1.5.1 From 590a2d904433ef87b4dc7c331d5e802a389b35a0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 26 Jun 2015 20:22:29 -0400 Subject: Updated Visual Studio 2010 project files --- crypto/BouncyCastle.Android.csproj | 7 +++++++ crypto/BouncyCastle.csproj | 7 +++++++ crypto/BouncyCastle.iOS.csproj | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index e5000145b..1c2f3e6ac 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -1045,6 +1045,7 @@ + @@ -1126,6 +1127,12 @@ + + + + + + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index 117af8d95..acb24726e 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -1039,6 +1039,7 @@ + @@ -1120,6 +1121,12 @@ + + + + + + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index a1d3b15a1..0a68e8238 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -1040,6 +1040,7 @@ + @@ -1121,6 +1122,12 @@ + + + + + + -- cgit 1.5.1 From 73bf641036960234fcb8d06ffa02676439207b14 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 26 Jun 2015 20:27:16 -0400 Subject: Reverted earlier change made to .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index edfb7e9ef..4989b01a5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,7 +5,7 @@ # to native line endings on checkout. *.build text diff=xml *.cs text diff=csharp -*.csproj text diff=xml eol=crlf +*.csproj text diff=xml *.eml text *.html text diff=html *.mdp text diff=xml -- cgit 1.5.1 From dffff172063680043e110e4567e910774be35dd6 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 26 Jun 2015 21:02:15 -0400 Subject: Strong-name the assemblies in the newer way --- crypto/BouncyCastle.Android.csproj | 10 ++++++++-- crypto/BouncyCastle.csproj | 10 ++++++++-- crypto/BouncyCastle.iOS.csproj | 10 ++++++++-- crypto/src/AssemblyInfo.cs | 33 --------------------------------- 4 files changed, 24 insertions(+), 39 deletions(-) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 1c2f3e6ac..a2a4d5a71 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -21,7 +21,7 @@ false bin\Debug\lib\MonoAndroid obj\Debug\lib\MonoAndroid - DEBUG;TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__ANDROID__; + DEBUG;TRACE;INCLUDE_IDEA;__MOBILE__;__ANDROID__; prompt 4 None @@ -32,12 +32,18 @@ true bin\Release\lib\MonoAndroid obj\Release\lib\MonoAndroid - TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__ANDROID__; + TRACE;INCLUDE_IDEA;__MOBILE__;__ANDROID__; prompt 4 false false + + true + + + ..\BouncyCastle.snk + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index acb24726e..bebc2a95f 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -17,7 +17,7 @@ false bin\Debug\lib\net20 obj\Debug\lib\net20 - DEBUG;TRACE;INCLUDE_IDEA;STRONG_NAME + DEBUG;TRACE;INCLUDE_IDEA; prompt 4 false @@ -26,13 +26,19 @@ true bin\Release\lib\net20 obj\Release\lib\net20 - TRACE;INCLUDE_IDEA;STRONG_NAME + TRACE;INCLUDE_IDEA; doc\BouncyCastle.xml prompt 4 false 1591 + + true + + + ..\BouncyCastle.snk + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 0a68e8238..18fd1c1d6 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -19,7 +19,7 @@ false bin\Debug\lib\Xamarin.iOS obj\Debug\lib\Xamarin.iOS - DEBUG;TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__IOS__; + DEBUG;TRACE;INCLUDE_IDEA;__MOBILE__;__IOS__; prompt 4 false @@ -28,11 +28,17 @@ true bin\Release\lib\Xamarin.iOS obj\Release\lib\Xamarin.iOS - TRACE;INCLUDE_IDEA;STRONG_NAME;__MOBILE__;__IOS__; + TRACE;INCLUDE_IDEA;__MOBILE__;__IOS__; prompt 4 false + + true + + + ..\BouncyCastle.snk + diff --git a/crypto/src/AssemblyInfo.cs b/crypto/src/AssemblyInfo.cs index 4a813bc5a..caabbc55c 100644 --- a/crypto/src/AssemblyInfo.cs +++ b/crypto/src/AssemblyInfo.cs @@ -31,39 +31,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyVersion("1.8.*")] -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -#if STRONG_NAME -[assembly: AssemblyKeyFile(@"../BouncyCastle.snk")] -#else -[assembly: AssemblyKeyFile("")] -#endif -[assembly: AssemblyKeyName("")] - [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] -- cgit 1.5.1 From 84f48308f82cbd65fe1b1ddc63da3bd0ce9e1bc7 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 27 Jun 2015 15:33:33 -0400 Subject: Added a nuspec file --- MimeKit.BouncyCastle.nuspec | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 MimeKit.BouncyCastle.nuspec diff --git a/MimeKit.BouncyCastle.nuspec b/MimeKit.BouncyCastle.nuspec new file mode 100644 index 000000000..c264e84f2 --- /dev/null +++ b/MimeKit.BouncyCastle.nuspec @@ -0,0 +1,47 @@ + + + + MimeKit.BouncyCastle + 1.8.0-RC1 + Bouncy Castle for MimeKit + Jeffrey Stedfast + jstedfast + https://github.com/jstedfast/bc-csharp + false + BouncyCastle 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 2, .NET 3.5, .NET 4.0, .NET 4.5, Xamarin.Android and Xamarin.iOS. + + en-US + bouncycastle, cryptography, encryption, security, net20, net35, net40, net45, xamarin, xamarin.android, xamarin.ios + + + + + + + + + + + + -- cgit 1.5.1 From b7b1edfe7d2991ea7044a8ef0831629e951bc8e0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 27 Jun 2015 16:24:31 -0400 Subject: Updated MimeKit.BouncyCastle.nuspec --- MimeKit.BouncyCastle.nuspec | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/MimeKit.BouncyCastle.nuspec b/MimeKit.BouncyCastle.nuspec index c264e84f2..c3e20c330 100644 --- a/MimeKit.BouncyCastle.nuspec +++ b/MimeKit.BouncyCastle.nuspec @@ -1,8 +1,8 @@ - + MimeKit.BouncyCastle - 1.8.0-RC1 + 1.7.90.1 Bouncy Castle for MimeKit Jeffrey Stedfast jstedfast @@ -29,19 +29,17 @@ -Time Stamp Protocol (TSP, RFC 3161). -TLS/SSL Client with support for client side authentication. - Support for .NET 2, .NET 3.5, .NET 4.0, .NET 4.5, Xamarin.Android and Xamarin.iOS. - + Support for .NET 2, .NET 3.5, .NET 4.0, .NET 4.5, Xamarin.Android and Xamarin.iOS. + BouncyCastle is a portable cryptography framework. en-US bouncycastle, cryptography, encryption, security, net20, net35, net40, net45, xamarin, xamarin.android, xamarin.ios - - - - - - - - + + + + + + - + \ No newline at end of file -- cgit 1.5.1 From 67f22caf3fa9d20364f5994b7d666370600d63ec Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 11 Oct 2015 10:37:20 -0400 Subject: Updated VS 2010 projects --- crypto/BouncyCastle.Android.csproj | 4 ++++ crypto/BouncyCastle.csproj | 4 ++++ crypto/BouncyCastle.iOS.csproj | 4 ++++ crypto/test/UnitTests.csproj | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index a2a4d5a71..697d7013e 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -645,6 +645,7 @@ + @@ -669,6 +670,7 @@ + @@ -686,6 +688,7 @@ + @@ -889,6 +892,7 @@ + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index bebc2a95f..72d9d6607 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -639,6 +639,7 @@ + @@ -663,6 +664,7 @@ + @@ -680,6 +682,7 @@ + @@ -883,6 +886,7 @@ + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 18fd1c1d6..5463434b2 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -640,6 +640,7 @@ + @@ -664,6 +665,7 @@ + @@ -681,6 +683,7 @@ + @@ -884,6 +887,7 @@ + diff --git a/crypto/test/UnitTests.csproj b/crypto/test/UnitTests.csproj index 3fd7154d9..c6345b7e5 100644 --- a/crypto/test/UnitTests.csproj +++ b/crypto/test/UnitTests.csproj @@ -187,6 +187,7 @@ + @@ -245,6 +246,7 @@ + @@ -407,6 +409,8 @@ + + -- cgit 1.5.1 From 1fdd3185a216d0d68ba9d2d658f76e43e2139f2e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 17 Oct 2015 11:04:30 -0400 Subject: Updated Visual Studio 2010 project files --- crypto/BouncyCastle.Android.csproj | 13 +++++++++++++ crypto/BouncyCastle.csproj | 13 +++++++++++++ crypto/BouncyCastle.iOS.csproj | 13 +++++++++++++ crypto/test/UnitTests.csproj | 13 +++++++++++++ 4 files changed, 52 insertions(+) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 697d7013e..666035e5d 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -536,6 +536,7 @@ + @@ -634,6 +635,7 @@ + @@ -641,9 +643,14 @@ + + + + + @@ -809,6 +816,7 @@ + @@ -913,6 +921,7 @@ + @@ -1255,6 +1264,7 @@ + @@ -1272,6 +1282,8 @@ + + @@ -1389,6 +1401,7 @@ + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index 72d9d6607..f8c0e03f7 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -530,6 +530,7 @@ + @@ -628,6 +629,7 @@ + @@ -635,9 +637,14 @@ + + + + + @@ -803,6 +810,7 @@ + @@ -907,6 +915,7 @@ + @@ -1249,6 +1258,7 @@ + @@ -1266,6 +1276,8 @@ + + @@ -1383,6 +1395,7 @@ + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 5463434b2..d1c125ef8 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -531,6 +531,7 @@ + @@ -629,6 +630,7 @@ + @@ -636,9 +638,14 @@ + + + + + @@ -804,6 +811,7 @@ + @@ -908,6 +916,7 @@ + @@ -1250,6 +1259,7 @@ + @@ -1267,6 +1277,8 @@ + + @@ -1384,6 +1396,7 @@ + diff --git a/crypto/test/UnitTests.csproj b/crypto/test/UnitTests.csproj index c6345b7e5..4a562a01a 100644 --- a/crypto/test/UnitTests.csproj +++ b/crypto/test/UnitTests.csproj @@ -261,6 +261,7 @@ + @@ -279,6 +280,7 @@ + @@ -324,8 +326,13 @@ + + + + + @@ -1058,6 +1065,8 @@ + + @@ -1078,6 +1087,10 @@ + + + + -- cgit 1.5.1 From 9108ef34bceef174f96e72a863ab80883c43f1da Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 18 Oct 2015 11:37:46 -0400 Subject: Updated Visual Studio 2010 project files --- crypto/BouncyCastle.Android.csproj | 7 +++++++ crypto/BouncyCastle.csproj | 7 +++++++ crypto/BouncyCastle.iOS.csproj | 7 +++++++ crypto/test/UnitTests.csproj | 4 ++++ 4 files changed, 25 insertions(+) diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 666035e5d..2d8dd0cf9 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -667,6 +667,13 @@ + + + + + + + diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index f8c0e03f7..959027f68 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -661,6 +661,13 @@ + + + + + + + diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index d1c125ef8..38ce14d70 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -662,6 +662,13 @@ + + + + + + + diff --git a/crypto/test/UnitTests.csproj b/crypto/test/UnitTests.csproj index 4a562a01a..3ef8c4db6 100644 --- a/crypto/test/UnitTests.csproj +++ b/crypto/test/UnitTests.csproj @@ -138,6 +138,10 @@ + + + + -- cgit 1.5.1