Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Mono.Cecil/AssemblyNameReference.cs')
-rw-r--r--Mono.Cecil/AssemblyNameReference.cs16
1 files changed, 7 insertions, 9 deletions
diff --git a/Mono.Cecil/AssemblyNameReference.cs b/Mono.Cecil/AssemblyNameReference.cs
index 6521dc6..78b0337 100644
--- a/Mono.Cecil/AssemblyNameReference.cs
+++ b/Mono.Cecil/AssemblyNameReference.cs
@@ -109,29 +109,27 @@ namespace Mono.Cecil {
byte [] HashPublicKey ()
{
+#if !PCL
HashAlgorithm algorithm;
switch (hash_algorithm) {
case AssemblyHashAlgorithm.Reserved:
-#if SILVERLIGHT
- throw new NotSupportedException ();
-#else
algorithm = MD5.Create ();
break;
-#endif
default:
// None default to SHA1
-#if SILVERLIGHT
- algorithm = new SHA1Managed ();
- break;
-#else
algorithm = SHA1.Create ();
break;
-#endif
}
using (algorithm)
return algorithm.ComputeHash (public_key);
+#else
+ if (hash_algorithm != AssemblyHashAlgorithm.SHA1)
+ throw new NotSupportedException ();
+
+ return new SHA1Managed ().ComputeHash (public_key);
+#endif
}
public virtual MetadataScopeType MetadataScopeType {