diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-08 19:41:15 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-08 19:41:15 +0700 |
commit | 3a14efc2a0f5bef8161969310cd3638a55a662f9 (patch) | |
tree | ccfa999d911e7ba2113ad79a620c1c11c8139d24 | |
parent | Whitespace, comments, unused import, missing test code (diff) | |
parent | Remove old TODO (diff) | |
download | BouncyCastle.NET-ed25519-3a14efc2a0f5bef8161969310cd3638a55a662f9.tar.xz |
Merge branch 'master' of git.bouncycastle.org:bc-csharp into pcl
-rw-r--r-- | crypto/crypto.csproj | 5 | ||||
-rw-r--r-- | crypto/src/asn1/DerGeneralizedTime.cs | 4 | ||||
-rw-r--r-- | crypto/src/asn1/DerUTCTime.cs | 4 | ||||
-rw-r--r-- | crypto/src/asn1/x509/Time.cs | 4 | ||||
-rw-r--r-- | crypto/src/util/Enums.cs | 4 | ||||
-rw-r--r-- | crypto/src/util/TypeExtensions.cs | 7 | ||||
-rw-r--r-- | crypto/test/src/util/test/SimpleTest.cs | 14 |
7 files changed, 28 insertions, 14 deletions
diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj index cdb48bfff..a1e217aca 100644 --- a/crypto/crypto.csproj +++ b/crypto/crypto.csproj @@ -6769,6 +6769,11 @@ BuildAction = "Compile" /> <File + RelPath = "src\util\TypeExtensions.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "src\util\collections\CollectionUtilities.cs" SubType = "Code" BuildAction = "Compile" diff --git a/crypto/src/asn1/DerGeneralizedTime.cs b/crypto/src/asn1/DerGeneralizedTime.cs index 40ec17b2a..17c42e7cf 100644 --- a/crypto/src/asn1/DerGeneralizedTime.cs +++ b/crypto/src/asn1/DerGeneralizedTime.cs @@ -83,7 +83,11 @@ namespace Org.BouncyCastle.Asn1 public DerGeneralizedTime( DateTime time) { +#if PORTABLE this.time = time.ToUniversalTime().ToString(@"yyyyMMddHHmmss\Z"); +#else + this.time = time.ToString(@"yyyyMMddHHmmss\Z"); +#endif } internal DerGeneralizedTime( diff --git a/crypto/src/asn1/DerUTCTime.cs b/crypto/src/asn1/DerUTCTime.cs index ebf57198f..4f0792636 100644 --- a/crypto/src/asn1/DerUTCTime.cs +++ b/crypto/src/asn1/DerUTCTime.cs @@ -86,7 +86,11 @@ namespace Org.BouncyCastle.Asn1 public DerUtcTime( DateTime time) { +#if PORTABLE this.time = time.ToUniversalTime().ToString("yyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#else + this.time = time.ToString("yyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#endif } internal DerUtcTime( diff --git a/crypto/src/asn1/x509/Time.cs b/crypto/src/asn1/x509/Time.cs index 770d59d46..ffe293521 100644 --- a/crypto/src/asn1/x509/Time.cs +++ b/crypto/src/asn1/x509/Time.cs @@ -34,7 +34,11 @@ namespace Org.BouncyCastle.Asn1.X509 public Time( DateTime date) { +#if PORTABLE string d = date.ToUniversalTime().ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#else + string d = date.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#endif int year = int.Parse(d.Substring(0, 4)); diff --git a/crypto/src/util/Enums.cs b/crypto/src/util/Enums.cs index 20b978c22..660bbe73f 100644 --- a/crypto/src/util/Enums.cs +++ b/crypto/src/util/Enums.cs @@ -44,13 +44,13 @@ namespace Org.BouncyCastle.Utilities internal static Array GetEnumValues(System.Type enumType) { #if NEW_REFLECTION - if(!enumType.GetTypeInfo().IsEnum) + if (!enumType.GetTypeInfo().IsEnum) #else if (!enumType.IsEnum) #endif throw new ArgumentException("Not an enumeration type", "enumType"); -#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT && !PORTABLE +#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT IList result = Platform.CreateArrayList(); FieldInfo[] fields = enumType.GetFields(BindingFlags.Static | BindingFlags.Public); foreach (FieldInfo field in fields) diff --git a/crypto/src/util/TypeExtensions.cs b/crypto/src/util/TypeExtensions.cs index c7ce807a0..e2aeae4dc 100644 --- a/crypto/src/util/TypeExtensions.cs +++ b/crypto/src/util/TypeExtensions.cs @@ -1,8 +1,8 @@ +#if NEW_REFLECTION + using System; using System.Reflection; -#if NEW_REFLECTION - namespace Org.BouncyCastle { internal static class TypeExtensions @@ -12,7 +12,6 @@ namespace Org.BouncyCastle return instance != null && type.GetTypeInfo().IsAssignableFrom(instance.GetType().GetTypeInfo()); } } - } -#endif \ No newline at end of file +#endif diff --git a/crypto/test/src/util/test/SimpleTest.cs b/crypto/test/src/util/test/SimpleTest.cs index d759674ea..faeee65c9 100644 --- a/crypto/test/src/util/test/SimpleTest.cs +++ b/crypto/test/src/util/test/SimpleTest.cs @@ -115,22 +115,20 @@ 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 +#if PORTABLE return "crypto.tests." + name; +#else + return "crypto.test.data." + name; #endif } 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 +#if PORTABLE return fullName.Substring("crypto.tests.".Length); +#else + return fullName.Substring("crypto.test.data.".Length); #endif } |