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
diff options
context:
space:
mode:
authorSebastien Pouliot <sebastien@ximian.com>2005-01-11 04:18:39 +0300
committerSebastien Pouliot <sebastien@ximian.com>2005-01-11 04:18:39 +0300
commit856abd7608cbfe0746c63bcf597bff6ff1d8953c (patch)
tree48dd3cdfd5aa696292d572f8d150a5daeefd5a6a /mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
parent1633c9eacc0ead66362a1979cf78f8b39278c08a (diff)
2005-01-10 Sebastien Pouliot <sebastien@ximian.com>
* CryptoConfig.cs: Change the OID for SHA-2 algorithms to match 2.0 and added new OID for asymmetric and symmetric algorithms. * CspKeyContainerInfo.cs: Added CryptoKeySecurity property. This will always return null until we support access control for key containers. * CspParameters.cs: Added new constructors and propertys for access control and password (2.0). * DSASignatureDeformatter.cs: Throw ArgumentNullException in NET_2_0 if a null key is specified. * DSASignatureFormatter.cs: Throw ArgumentNullException in NET_2_0 if a null key is specified. * HashAlgorithm.cs: Fix the reported exceptions for output buffers. * HMAC.cs: Change the .Clear (which calls Dispose) to a .Initialize. * MACTripleDES.cs: Removed unrequired private field _padding. * PasswordDeriveBytes.cs: Added 4 new constructors where the password is a byte[] (as it seems MS won't be using SecureString for this). * RIPEMD160Managed.cs: Removed overriden Dispose method to match 2.0. Clear buffers when initializing (e.g. re-using the hash instance). * Rfc2898DeriveBytes.cs: Added a new constructor where the password is a byte[] (as it seems MS won't be using SecureString for this). * RSAPKCS1SignatureDeformatter.cs: Throw ArgumentNullException in NET_2_0 if a null key is specified. * RSAPKCS1SignatureFormatter.cs: Throw ArgumentNullException in NET_2_0 if a null key is specified. * ToBase64Transform.cs: Fix the reported exceptions for output buffers. svn path=/trunk/mcs/; revision=38667
Diffstat (limited to 'mcs/class/corlib/System.Security.Cryptography/CspParameters.cs')
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CspParameters.cs58
1 files changed, 48 insertions, 10 deletions
diff --git a/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs b/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
index db5a592c348..8cb3e1c519b 100755
--- a/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
@@ -1,14 +1,11 @@
//
// System.Security.Cryptography CspParameters.cs
//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
+// Authors:
+// Thomas Neidhart (tome@sbox.tugraz.at)
+// Sebastien Pouliot <sebastien@ximian.com>
//
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -29,8 +26,10 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-
-using System;
+
+#if NET_2_0
+using System.Security.AccessControl;
+#endif
namespace System.Security.Cryptography {
@@ -74,6 +73,45 @@ namespace System.Security.Cryptography {
public CspProviderFlags Flags {
get { return _Flags; }
set { _Flags = value; }
- }
+ }
+
+#if NET_2_0
+ private SecureString _password;
+ private IntPtr _windowHandle;
+
+ public CspParameters (int dwTypeIn, string strProviderNameIn, string strContainerNameIn,
+ CryptoKeySecurity cryptoKeySecurity, IntPtr parentWindowHandle)
+ : this (dwTypeIn, strProviderNameIn, strContainerNameIn)
+ {
+ if (cryptoKeySecurity != null)
+ CryptoKeySecurity = cryptoKeySecurity;
+ _windowHandle = parentWindowHandle;
+ }
+
+ public CspParameters (int dwTypeIn, string strProviderNameIn, string strContainerNameIn,
+ CryptoKeySecurity cryptoKeySecurity, SecureString keyPassword)
+ : this (dwTypeIn, strProviderNameIn, strContainerNameIn)
+ {
+ if (cryptoKeySecurity != null)
+ CryptoKeySecurity = cryptoKeySecurity;
+ _password = keyPassword;
+ }
+
+ [MonoTODO ("access control isn't implemented")]
+ public CryptoKeySecurity CryptoKeySecurity {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ public SecureString KeyPassword {
+ get { return _password; }
+ set { _password = value; }
+ }
+
+ public IntPtr ParentWindowHandle {
+ get { return _windowHandle; }
+ set { _windowHandle = value; }
+ }
+#endif
}
}