get {
if (rsa == null)
return false;
-#if INSIDE_CORLIB
+#if INSIDE_CORLIB && !MOONLIGHT
// the easy way
if (RSA is RSACryptoServiceProvider) {
// available as internal for corlib
public bool Verify (string fileName)
{
- StrongNameSignature sn;
+ bool result = false;
using (FileStream fs = File.OpenRead (fileName)) {
- sn = StrongHash (fs, StrongNameOptions.Signature);
+ result = Verify (fs);
fs.Close ();
}
+ return result;
+ }
+
+ public bool Verify (Stream stream)
+ {
+ StrongNameSignature sn = StrongHash (stream, StrongNameOptions.Signature);
if (sn.Hash == null) {
return false;
}
if (!initialized) {
lock (lockObject) {
if (!initialized) {
+#if NET_2_1
+ // Moonlight cannot depend on machine.config
+#else
string config = Environment.GetMachineConfigPath ();
StrongNameManager.LoadConfig (config);
+#endif
initialized = true;
}
}