2 // System.Security.Cryptography CspParameters.cs
\r
5 // Thomas Neidhart (tome@sbox.tugraz.at)
\r
6 // Sebastien Pouliot <sebastien@ximian.com>
8 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Security.AccessControl;
34 namespace System.Security.Cryptography {
\r
36 public sealed class CspParameters {
38 private CspProviderFlags _Flags;
\r
40 public CspParameters ()
45 public CspParameters (int dwTypeIn)
46 : this (dwTypeIn, null)
50 public CspParameters (int dwTypeIn, string strProviderNameIn)
51 : this (dwTypeIn, null, null)
55 public CspParameters (int dwTypeIn, string strProviderNameIn, string strContainerNameIn)
\r
57 ProviderType = dwTypeIn;
\r
58 ProviderName = strProviderNameIn;
\r
59 KeyContainerName = strContainerNameIn;
\r
61 // not defined in specs, only tested from M$ impl
\r
65 public string KeyContainerName;
\r
67 public int KeyNumber;
\r
69 public string ProviderName;
\r
71 public int ProviderType;
\r
73 public CspProviderFlags Flags {
\r
74 get { return _Flags; }
\r
75 set { _Flags = value; }
\r
79 private SecureString _password;
80 private IntPtr _windowHandle;
82 public CspParameters (int dwTypeIn, string strProviderNameIn, string strContainerNameIn,
83 CryptoKeySecurity cryptoKeySecurity, IntPtr parentWindowHandle)
84 : this (dwTypeIn, strProviderNameIn, strContainerNameIn)
86 if (cryptoKeySecurity != null)
87 CryptoKeySecurity = cryptoKeySecurity;
88 _windowHandle = parentWindowHandle;
91 public CspParameters (int dwTypeIn, string strProviderNameIn, string strContainerNameIn,
92 CryptoKeySecurity cryptoKeySecurity, SecureString keyPassword)
93 : this (dwTypeIn, strProviderNameIn, strContainerNameIn)
95 if (cryptoKeySecurity != null)
96 CryptoKeySecurity = cryptoKeySecurity;
97 _password = keyPassword;
100 [MonoTODO ("access control isn't implemented")]
101 public CryptoKeySecurity CryptoKeySecurity {
102 get { throw new NotImplementedException (); }
103 set { throw new NotImplementedException (); }
106 public SecureString KeyPassword {
107 get { return _password; }
108 set { _password = value; }
111 public IntPtr ParentWindowHandle {
112 get { return _windowHandle; }
113 set { _windowHandle = value; }