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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorSebastien Pouliot <sebastien@xamarin.com>2013-06-07 19:10:45 +0400
committerSebastien Pouliot <sebastien@xamarin.com>2013-06-07 19:10:59 +0400
commit50ab3fadd1dd502979ab90ec0735a0316a710e16 (patch)
tree3f0c60b88b1180f3580adafdf6f3cdd8ca8070a0 /mcs
parent7d5f81f04db36cdeeff71472c208a3150b554ae0 (diff)
[ios] Remove code path using UseMachineKeyStore since it's not available (and bring extra code inside applications)
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/Mono.Security/Mono.Security.Cryptography/PKCS8.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/mcs/class/Mono.Security/Mono.Security.Cryptography/PKCS8.cs b/mcs/class/Mono.Security/Mono.Security.Cryptography/PKCS8.cs
index 164466487e1..352e4649b0e 100644
--- a/mcs/class/Mono.Security/Mono.Security.Cryptography/PKCS8.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Cryptography/PKCS8.cs
@@ -3,10 +3,11 @@
// ftp://ftp.rsasecurity.com/pub/pkcs/doc/pkcs-8.doc
//
// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
+// Sebastien Pouliot <sebastien@xamarin.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
// Copyright (C) 2004-2006 Novell Inc. (http://www.novell.com)
+// Copyright 2013 Xamarin Inc. (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -31,15 +32,12 @@
using System;
using System.Collections;
using System.Security.Cryptography;
-using System.Text;
using Mono.Security.X509;
namespace Mono.Security.Cryptography {
-#if INSIDE_CORLIB
- internal
-#else
+#if !INSIDE_CORLIB
public
#endif
sealed class PKCS8 {
@@ -279,6 +277,11 @@ namespace Mono.Security.Cryptography {
rsa.ImportParameters (param);
}
catch (CryptographicException) {
+#if MONOTOUCH
+ // there's no machine-wide store available for iOS so we can drop the dependency on
+ // CspParameters (which drops other things, like XML key persistance, unless used elsewhere)
+ throw;
+#else
// this may cause problem when this code is run under
// the SYSTEM identity on Windows (e.g. ASP.NET). See
// http://bugzilla.ximian.com/show_bug.cgi?id=77559
@@ -286,6 +289,7 @@ namespace Mono.Security.Cryptography {
csp.Flags = CspProviderFlags.UseMachineKeyStore;
rsa = new RSACryptoServiceProvider (csp);
rsa.ImportParameters (param);
+#endif
}
return rsa;
}