dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] pnetlib/runtime/System/Security/Cryptography CspKe


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/runtime/System/Security/Cryptography CspKeyContainerInfo.cs, NONE, 1.1 DataProtectionScope.cs, NONE, 1.1 HMAC.cs, NONE, 1.1 HMACMD5.cs, NONE, 1.1 HMACRIPEMD160.cs, NONE, 1.1 HMACSHA256.cs, NONE, 1.1 HMACSHA384.cs, NONE, 1.1 HMACSHA512.cs, NONE, 1.1 ICspAsymmeticAlgorithm.cs, NONE, 1.1 KeyNumber.cs, NONE, 1.1 MemoryProtectionScope.cs, NONE, 1.1 ProtectedData.cs, NONE, 1.1 ProtectedMemory.cs, NONE, 1.1 RIPEMD160.cs, NONE, 1.1 RIPEMD160Managed.cs, NONE, 1.1 Rfc2898DeriveBytes.cs, NONE, 1.1 CryptoConfig.cs, 1.8, 1.9 CspProviderFlags.cs, 1.2, 1.3 HMACSHA1.cs, 1.4, 1.5 PaddingMode.cs, 1.2, 1.3 PasswordDeriveBytes.cs, 1.3, 1.4
Date: Fri, 28 Nov 2003 01:56:31 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography
In directory subversions:/tmp/cvs-serv29792/runtime/System/Security/Cryptography

Modified Files:
        CryptoConfig.cs CspProviderFlags.cs HMACSHA1.cs PaddingMode.cs 
        PasswordDeriveBytes.cs 
Added Files:
        CspKeyContainerInfo.cs DataProtectionScope.cs HMAC.cs 
        HMACMD5.cs HMACRIPEMD160.cs HMACSHA256.cs HMACSHA384.cs 
        HMACSHA512.cs ICspAsymmeticAlgorithm.cs KeyNumber.cs 
        MemoryProtectionScope.cs ProtectedData.cs ProtectedMemory.cs 
        RIPEMD160.cs RIPEMD160Managed.cs Rfc2898DeriveBytes.cs 
Log Message:


Add the framework 1.2 cryptography classes.


--- NEW FILE: HMACMD5.cs ---
/*
 * HMACMD5.cs - Implementation of the
 *              "System.Security.Cryptography.HMACMD5" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using Platform;

public class HMACMD5 : HMAC
{
        // Constructors.
        public HMACMD5()
                        {
                                HashName = "MD5";
                                HashSizeValue = 128;
                                byte[] key = new byte [64];
                                CryptoMethods.GenerateRandom(key, 0, 64);
                        }
        public HMACMD5(byte[] rgbKey)
                        {
                                HashName = "MD5";
                                HashSizeValue = 128;
                                Key = rgbKey;
                        }

        // Destructor.
        ~HMACMD5()
                        {
                                Dispose(false);
                        }

}; // class HMACMD5

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: CspKeyContainerInfo.cs ---
/*
 * CspKeyContainerInfo.cs - Implementation of the
 *              "System.Security.Cryptography.CspKeyContainerInfo" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

public sealed class CspKeyContainerInfo
{
        // Internal state.
        private CspParameters parameters;
        private bool randomlyGenerated;

        // Constructors.
        public CspKeyContainerInfo(CspParameters parameters)
                        {
                                this.parameters = parameters;
                                this.randomlyGenerated = true;
                        }
        internal CspKeyContainerInfo(CspParameters parameters, bool random)
                        {
                                this.parameters = parameters;
                                this.randomlyGenerated = random;
                        }

        // Get this object's properties.  Most of these have fake values
        // because we don't use CSP's, hardware devices, or machine key stores.
        public bool Accessible
                        {
                                get
                                {
                                        return true;
                                }
                        }
        public bool Exportable
                        {
                                get
                                {
                                        return true;
                                }
                        }
        public bool HardwareDevice
                        {
                                get
                                {
                                        return true;
                                }
                        }
        public String KeyContainerName
                        {
                                get
                                {
                                        return parameters.KeyContainerName;
                                }
                        }
        public KeyNumber KeyNumber
                        {
                                get
                                {
                                        return 
(KeyNumber)(parameters.KeyNumber);
                                }
                        }
        public bool MachineKeyStore
                        {
                                get
                                {
                                        return false;
                                }
                        }
        public bool Protected
                        {
                                get
                                {
                                        return false;
                                }
                        }
        public String ProviderName
                        {
                                get
                                {
                                        return parameters.ProviderName;
                                }
                        }
        public int ProviderType
                        {
                                get
                                {
                                        return parameters.ProviderType;
                                }
                        }
        public bool RandomlyGenerated
                        {
                                get
                                {
                                        return randomlyGenerated;
                                }
                        }
        public bool Removable
                        {
                                get
                                {
                                        return false;
                                }
                        }
        public String UniqueKeyContainerName
                        {
                                get
                                {
                                        return ProviderName + "\\" + 
KeyContainerName;
                                }
                        }

}; // class CspKeyContainerInfo

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

Index: HMACSHA1.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/HMACSHA1.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** HMACSHA1.cs 29 May 2003 01:22:41 -0000      1.4
--- HMACSHA1.cs 28 Nov 2003 01:56:28 -0000      1.5
***************
*** 3,7 ****
   *            "System.Security.Cryptography.HMACSHA1" class.
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 3,7 ----
   *            "System.Security.Cryptography.HMACSHA1" class.
   *
!  * Copyright (C) 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 28,31 ****
--- 28,33 ----
  using Platform;
  
+ #if !CONFIG_FRAMEWORK_1_2
+ 
  public class HMACSHA1 : KeyedHashAlgorithm
  {
***************
*** 168,171 ****
--- 170,202 ----
  
  }; // class HMACSHA1
+ 
+ #else // CONFIG_FRAMEWORK_1_2
+ 
+ public class HMACSHA1 : HMAC
+ {
+       // Constructors.
+       public HMACSHA1()
+                       {
+                               HashName = "SHA1";
+                               HashSizeValue = 160;
+                               byte[] key = new byte [64];
+                               CryptoMethods.GenerateRandom(key, 0, 64);
+                       }
+       public HMACSHA1(byte[] rgbKey)
+                       {
+                               HashName = "SHA1";
+                               HashSizeValue = 160;
+                               Key = rgbKey;
+                       }
+ 
+       // Destructor.
+       ~HMACSHA1()
+                       {
+                               Dispose(false);
+                       }
+ 
+ }; // class HMACSHA1
+ 
+ #endif // CONFIG_FRAMEWORK_1_2
  
  #endif // CONFIG_CRYPTO

Index: PaddingMode.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/PaddingMode.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PaddingMode.cs      29 May 2003 01:22:41 -0000      1.2
--- PaddingMode.cs      28 Nov 2003 01:56:28 -0000      1.3
***************
*** 3,7 ****
   *            "System.Security.Cryptography.PaddingMode" class.
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 3,7 ----
   *            "System.Security.Cryptography.PaddingMode" class.
   *
!  * Copyright (C) 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 27,33 ****
  public enum PaddingMode
  {
!       None  = 1,
!       PKCS7 = 2,
!       Zeros = 3
  
  }; // enum PaddingMode
--- 27,37 ----
  public enum PaddingMode
  {
!       None            = 1,
!       PKCS7           = 2,
!       Zeros           = 3,
! #if CONFIG_FRAMEWORK_1_2
!       ANSIX923        = 4,
!       ISO10126        = 5
! #endif
  
  }; // enum PaddingMode

Index: PasswordDeriveBytes.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/PasswordDeriveBytes.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PasswordDeriveBytes.cs      29 May 2003 01:22:41 -0000      1.3
--- PasswordDeriveBytes.cs      28 Nov 2003 01:56:28 -0000      1.4
***************
*** 34,40 ****
        // Internal state.
        private String strPassword;
!       private byte[] rgbSalt;
        private String strHashName;
!       private int iterations;
        private HashAlgorithm hashAlgorithm;
        private int blockNum, posn, size;
--- 34,40 ----
        // Internal state.
        private String strPassword;
!       internal byte[] rgbSalt;
        private String strHashName;
!       internal int iterations;
        private HashAlgorithm hashAlgorithm;
        private int blockNum, posn, size;

--- NEW FILE: KeyNumber.cs ---
/*
 * KeyNumber.cs - Implementation of the
 *              "System.Security.Cryptography.KeyNumber" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

public enum KeyNumber
{
        Exchange        = 0,
        Signature       = 1

}; // enum KeyNumber

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: Rfc2898DeriveBytes.cs ---
/*
 * Rfc2898DeriveBytes.cs - Implementation of the
 *              "System.Security.Cryptography.Rfc2898DeriveBytes" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using System;
using Platform;
using System.Text;

// Both "PasswordDeriveBytes" and "Rfc2898DeriveBytes" implement
// PKCS #5 v2.0.  The only difference between the two classes is
// that this one uses SHA1 as the fixed hash algorithm.  Because
// of this, we just wrap this class around "PasswordDeriveBytes".

public class Rfc2898DeriveBytes : DeriveBytes
{
        // Internal state.
        private PasswordDeriveBytes db;

        // Constructors.
        public Rfc2898DeriveBytes(String password, int saltSize)
                        : this(password, GenerateSalt(saltSize), 1000) {}
        public Rfc2898DeriveBytes(String password, int saltSize, int iterations)
                        : this(password, GenerateSalt(saltSize), iterations) {}
        public Rfc2898DeriveBytes(String password, byte[] salt)
                        : this(password, salt, 1000) {}
        public Rfc2898DeriveBytes(String password, byte[] salt, int iterations)
                        {
                                if(password == null)
                                {
                                        throw new 
ArgumentNullException("password");
                                }
                                if(salt == null)
                                {
                                        throw new ArgumentNullException("salt");
                                }
                                if(salt.Length < 8)
                                {
                                        throw new 
ArgumentException(_("Crypto_SaltSize"));
                                }
                                db = new PasswordDeriveBytes
                                        (password, salt, "SHA1", iterations);
                        }

        // Generate a random salt of a particular size.
        private static byte[] GenerateSalt(int saltSize)
                        {
                                if(saltSize < 0)
                                {
                                        throw new ArgumentOutOfRangeException
                                                ("saltSize", 
_("ArgRange_NonNegative"));
                                }
                                byte[] salt = new byte [saltSize];
                                CryptoMethods.GenerateRandom(salt, 0, saltSize);
                                return salt;
                        }

        // Get or set the iteration count.
        public int IterationCount
                        {
                                get
                                {
                                        return db.IterationCount;
                                }
                                set
                                {
                                        if(value < 1)
                                        {
                                                throw new 
ArgumentOutOfRangeException
                                                        ("value", 
_("ArgRange_PositiveNonZero"));
                                        }
                                        db.iterations = value;
                                }
                        }

        // Get or set the salt.
        public byte[] Salt
                        {
                                get
                                {
                                        return db.Salt;
                                }
                                set
                                {
                                        if(value == null)
                                        {
                                                throw new 
ArgumentNullException("value");
                                        }
                                        if(value.Length < 8)
                                        {
                                                throw new 
ArgumentException(_("Crypto_SaltSize"));
                                        }
                                        db.rgbSalt = (byte[])(value.Clone());
                                }
                        }

        // Get the pseudo-random key bytes.
        public override byte[] GetBytes(int cb)
                        {
                                if(cb < 1)
                                {
                                        throw new ArgumentOutOfRangeException
                                                ("cb", 
_("ArgRange_PositiveNonZero"));
                                }
                                return db.GetBytes(cb);
                        }

        // Reset the state.
        public override void Reset()
                        {
                                db.Reset();
                        }

}; // class Rfc2898DeriveBytes

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: HMACSHA512.cs ---
/*
 * HMACSHA512.cs - Implementation of the
 *              "System.Security.Cryptography.HMACSHA512" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using Platform;

public class HMACSHA512 : HMAC
{
        // Constructors.
        public HMACSHA512()
                        {
                                HashName = "SHA512";
                                HashSizeValue = 512;
                                byte[] key = new byte [64];
                                CryptoMethods.GenerateRandom(key, 0, 64);
                        }
        public HMACSHA512(byte[] rgbKey)
                        {
                                HashName = "SHA512";
                                HashSizeValue = 512;
                                Key = rgbKey;
                        }

        // Destructor.
        ~HMACSHA512()
                        {
                                Dispose(false);
                        }

}; // class HMACSHA512

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: ProtectedMemory.cs ---
/*
 * ProtectedMemory.cs - Implementation of the
 *              "System.Security.Cryptography.ProtectedMemory" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

// Read the comments in "ProtectedData.cs" before using this class.

public sealed class ProtectedMemory
{
        // Cannot instantiate this class.
        private ProtectedMemory() {}

        // Protect a block of memory.
        public static void Protect
                                (byte[] userData, MemoryProtectionScope scope)
                        {
                                if(userData == null)
                                {
                                        throw new 
ArgumentNullException("userData");
                                }
                                if((userData.Length % 16) != 0)
                                {
                                        throw new 
CryptographicException(_("Crypto_MultOf16"));
                                }
                                ProtectedData.Protect(userData, null, scope, 
userData);
                        }

        // Unprotect a block of memory.
        public static void Unprotect
                                (byte[] encryptedData, MemoryProtectionScope 
scope)
                        {
                                if(encryptedData == null)
                                {
                                        throw new 
ArgumentNullException("encryptedData");
                                }
                                if((encryptedData.Length % 16) != 0)
                                {
                                        throw new 
CryptographicException(_("Crypto_MultOf16"));
                                }
                                ProtectedData.Unprotect
                                        (encryptedData, null, scope, 
encryptedData);
                        }

}; // class ProtectedMemory

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

Index: CryptoConfig.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/CryptoConfig.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CryptoConfig.cs     29 May 2003 01:22:41 -0000      1.8
--- CryptoConfig.cs     28 Nov 2003 01:56:28 -0000      1.9
***************
*** 62,65 ****
--- 62,71 ----
        internal const String RSADefault =
                        "System.Security.Cryptography.RSA";
+ #if CONFIG_FRAMEWORK_1_2
+       internal const String HMACDefault =
+               "System.Security.Cryptography.HMAC";
+       internal const String RIPEMD160Default =
+               "System.Security.Cryptography.RIPEMD160";
+ #endif
  
        // Table that maps algorithm names to implementations.
***************
*** 92,95 ****
--- 98,110 ----
                                                                
typeof(SHA512Managed),
  
+ #if CONFIG_FRAMEWORK_1_2
+ 
+                       "RIPEMD160",            typeof(RIPEMD160Managed),
+                       "RIPEMD-160",           typeof(RIPEMD160Managed),
+                       "System.Security.Cryptography.RIPEMD160",
+                                                               
typeof(RIPEMD160Managed),
+ 
+ #endif // CONFIG_FRAMEWORK_1_2
+ 
                        "RSA",                          
typeof(RSACryptoServiceProvider),
                        "System.Security.Cryptography.RSA",
***************
*** 121,124 ****
--- 136,166 ----
                        "System.Security.Cryptography.MACTripleDES",
                                                                
typeof(MACTripleDES),
+ 
+ #if CONFIG_FRAMEWORK_1_2
+ 
+                       "System.Security.Cryptography.HMAC",
+                                                               
typeof(HMACSHA1),
+ 
+                       "HMACMD5",                      typeof(HMACMD5),
+                       "System.Security.Cryptography.HMACMD5",
+                                                               typeof(HMACMD5),
+ 
+                       "HMACSHA256",           typeof(HMACSHA256),
+                       "System.Security.Cryptography.HMACSHA256",
+                                                               
typeof(HMACSHA256),
+ 
+                       "HMACSHA384",           typeof(HMACSHA384),
+                       "System.Security.Cryptography.HMACSHA384",
+                                                               
typeof(HMACSHA384),
+ 
+                       "HMACSHA512",           typeof(HMACSHA512),
+                       "System.Security.Cryptography.HMACSHA512",
+                                                               
typeof(HMACSHA512),
+ 
+                       "HMACRIPEMD160",        typeof(HMACRIPEMD160),
+                       "System.Security.Cryptography.HMACRIPEMD160",
+                                                               
typeof(HMACRIPEMD160),
+ 
+ #endif // CONFIG_FRAMEWORK_1_2
  
                        "DES",                          
typeof(DESCryptoServiceProvider),

--- NEW FILE: HMACSHA256.cs ---
/*
 * HMACSHA256.cs - Implementation of the
 *              "System.Security.Cryptography.HMACSHA256" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using Platform;

public class HMACSHA256 : HMAC
{
        // Constructors.
        public HMACSHA256()
                        {
                                HashName = "SHA256";
                                HashSizeValue = 256;
                                byte[] key = new byte [64];
                                CryptoMethods.GenerateRandom(key, 0, 64);
                        }
        public HMACSHA256(byte[] rgbKey)
                        {
                                HashName = "SHA256";
                                HashSizeValue = 256;
                                Key = rgbKey;
                        }

        // Destructor.
        ~HMACSHA256()
                        {
                                Dispose(false);
                        }

}; // class HMACSHA256

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: HMAC.cs ---
/*
 * HMAC.cs - Implementation of the
 *              "System.Security.Cryptography.HMAC" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using System;

public abstract class HMAC : KeyedHashAlgorithm
{
        // Internal state.
        protected int BlockSizeValue;
        private HashAlgorithm alg;
        private String algName;

        // Constructor.
        protected HMAC()
                        {
                                BlockSizeValue = 1;
                        }

        // Create an instance of the default HMAC algorithm.
        public new static HMAC Create()
                        {
                                return (HMAC)(CryptoConfig.CreateFromName
                                        (CryptoConfig.HMACDefault, null));
                        }

        // Create an instance of a specific HMAC algorithm.
        public new static HMAC Create(String algName)
                        {
                                return 
(HMAC)(CryptoConfig.CreateFromName(algName, null));
                        }

        // Dispose this object.
        protected override void Dispose(bool disposing)
                        {
                                if(alg != null)
                                {
                                        ((IDisposable)alg).Dispose();
                                }
                                base.Dispose(disposing);
                        }

        // Initialize the key.  If it is 64 bytes or less, then use
        // it as-is.  Otherwise hash it down.
        private void SetKey(byte[] key)
                        {
                                if(key.Length <= 64)
                                {
                                        KeyValue = key;
                                }
                                else
                                {
                                        KeyValue = alg.ComputeHash(key);
                                }
                        }

        // Get or set the hash key.
        public override byte[] Key
                        {
                                get
                                {
                                        return KeyValue;
                                }
                                set
                                {
                                        if(State != 0)
                                        {
                                                throw new CryptographicException
                                                        
(_("Crypto_HashInProgress"));
                                        }
                                        else if(value == null)
                                        {
                                                throw new 
ArgumentNullException("value");
                                        }
                                        SetKey(value);
                                }
                        }

        // Get or set the name of the hash algorithm implementation.
        public String HashName
                        {
                                get
                                {
                                        return algName;
                                }
                                set
                                {
                                        algName = value;
                                        alg = HashAlgorithm.Create(algName);
                                }
                        }

        // Initialize the hash algorithm.
        public override void Initialize()
                        {
                                if(alg != null)
                                {
                                        alg.Initialize();
                                }
                                alg = null;
                        }

        // Prepare the hash for the initial call to "HashCore" or "HashFinal".
        private void Prepare()
                        {
                                if(alg == null)
                                {
                                        alg = SHA1.Create(algName);
                                        if(KeyValue != null)
                                        {
                                                alg.InternalHashCore(KeyValue, 
0, KeyValue.Length);
                                        }
                                }
                        }

        // Write data to the underlying hash algorithm.
        protected override void HashCore(byte[] array, int ibStart, int cbSize)
                        {
                                Prepare();
                                alg.InternalHashCore(array, ibStart, cbSize);
                        }

        // Finalize the hash and return the final hash value.
        protected override byte[] HashFinal()
                        {
                                // Compute the final hash, which is "H(K, H(K, 
Data))".
                                Prepare();
                                byte[] inner = alg.InternalHashFinal();
                                alg.Initialize();
                                if(KeyValue != null)
                                {
                                        alg.InternalHashCore(KeyValue, 0, 
KeyValue.Length);
                                }
                                alg.InternalHashCore(inner, 0, inner.Length);
                                Array.Clear(inner, 0, inner.Length);
                                return alg.InternalHashFinal();
                        }

}; // class HMAC

#endif // CONFIG_CRYPTO

}; // namespace System.Security.Cryptography

--- NEW FILE: HMACRIPEMD160.cs ---
/*
 * HMACRIPEMD160.cs - Implementation of the
 *              "System.Security.Cryptography.HMACRIPEMD160" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using Platform;

public class HMACRIPEMD160 : HMAC
{
        // Constructors.
        public HMACRIPEMD160()
                        {
                                HashName = "RIPEMD160";
                                HashSizeValue = 160;
                                byte[] key = new byte [64];
                                CryptoMethods.GenerateRandom(key, 0, 64);
                        }
        public HMACRIPEMD160(byte[] rgbKey)
                        {
                                HashName = "RIPEMD160";
                                HashSizeValue = 160;
                                Key = rgbKey;
                        }

        // Destructor.
        ~HMACRIPEMD160()
                        {
                                Dispose(false);
                        }

}; // class HMACRIPEMD160

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: ICspAsymmeticAlgorithm.cs ---
/*
 * ICspAsymmetricAlgorithm.cs - Implementation of the
 *              "System.Security.Cryptography.ICspAsymmetricAlgorithm" 
interface.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

public interface ICspAsymmetricAlgorithm
{
        // Get the key container information.
        CspKeyContainerInfo CspKeyContainerInfo { get; }

        // Export the key as a byte blob.
        byte[] ExportCspBlob(bool includePrivateParameters);

        // Import the key from a byte blob.
        void ImportCspBlob(byte[] rawData);

}; // interface ICspAsymmetricAlgorithm

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: ProtectedData.cs ---
/*
 * ProtectedData.cs - Implementation of the
 *              "System.Security.Cryptography.ProtectedData" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

// The Microsoft version of this class uses master keys, encrypted by
// the user's password, to protect the data.  Access to the plaintext of
// the user's password is not possible in most systems, for good reason.
//
// We use a simpler scrambling algorihm, based on AES, that uses a
// fixed key based on the user's login identifier and the machine name.
// This provides some casual protection, but no real security against a
// real adversary.
//
// Key management needs to be done carefully, and Microsoft's approach to
// it is flat out *wrong*.  Anyone with access to the memory of the machine
// can discover the user's password with ease by merely installing a trojan,
// or engaging in some form of social engineering (e.g. pop up a dialog box
// and just ask the user for the password because they are conditioned to
// provide it on demand).
//
// Use of this API for any purpose is highly discouraged.

public sealed class ProtectedData
{
        // Cannot instantiate this class.
        private ProtectedData() {}

        // Get the encryption key to use to protect memory for a scope.
        private static byte[] GetScopeKey(MemoryProtectionScope scope, byte[] 
salt)
                        {
                                String key;
                                PasswordDeriveBytes derive;
                                if(scope == MemoryProtectionScope.SameLogon)
                                {
                                        key = Environment.UserName;
                                }
                                else
                                {
                                        key = Environment.UserName + "/" + 
Environment.MachineName;
                                }
                                if(salt == null)
                                {
                                        salt = new byte [16];
                                }
                                derive = new PasswordDeriveBytes(key, salt);
                                return derive.CryptDeriveKey("Rijndael", 
"SHA1", 16, null);
                        }

        // Protect a block of memory.
        internal static void Protect
                                (byte[] userData, byte[] optionalEntropy,
                                 MemoryProtectionScope scope, byte[] output)
                        {
                                // Get the key to use.
                                byte[] key = GetScopeKey(scope, 
optionalEntropy);

                                // Encrypt the block of memory using AES.
                                Rijndael alg = new RijndaelManaged();
                                alg.Mode = CipherMode.CFB;
                                ICryptoTransform transform = 
alg.CreateEncryptor(key, null);
                                transform.TransformBlock
                                        (userData, 0, userData.Length, output, 
0);
                                transform.Dispose();
                                alg.Clear();
                                Array.Clear(key, 0, key.Length);
                        }
        public static byte[] Protect
                                (byte[] userData, byte[] optionalEntropy,
                                 MemoryProtectionScope scope)
                        {
                                // Validate the parameters.
                                if(userData == null)
                                {
                                        throw new 
ArgumentNullException("userData");
                                }

                                // Protect the data and return it.
                                byte[] output = new byte [userData.Length];
                                Protect(userData, optionalEntropy, scope, 
output);
                                return output;
                        }

        // Unprotect a block of memory.
        internal static void Unprotect
                                (byte[] encryptedData, byte[] optionalEntropy,
                                 MemoryProtectionScope scope, byte[] output)
                        {
                                // Get the key to use.
                                byte[] key = GetScopeKey(scope, 
optionalEntropy);

                                // Decrypt the block of memory using AES.
                                Rijndael alg = new RijndaelManaged();
                                alg.Mode = CipherMode.CFB;
                                ICryptoTransform transform = 
alg.CreateDecryptor(key, null);
                                transform.TransformBlock
                                        (encryptedData, 0, 
encryptedData.Length, output, 0);
                                transform.Dispose();
                                alg.Clear();
                                Array.Clear(key, 0, key.Length);
                        }
        public static byte[] Unprotect
                                (byte[] encryptedData, byte[] optionalEntropy,
                                 MemoryProtectionScope scope)
                        {
                                // Validate the parameters.
                                if(encryptedData == null)
                                {
                                        throw new 
ArgumentNullException("encryptedData");
                                }

                                // Unprotect the data and return it.
                                byte[] output = new byte [encryptedData.Length];
                                Unprotect(encryptedData, optionalEntropy, 
scope, output);
                                return output;
                        }

}; // class ProtectedData

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: HMACSHA384.cs ---
/*
 * HMACSHA384.cs - Implementation of the
 *              "System.Security.Cryptography.HMACSHA384" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using Platform;

public class HMACSHA384 : HMAC
{
        // Constructors.
        public HMACSHA384()
                        {
                                HashName = "SHA384";
                                HashSizeValue = 384;
                                byte[] key = new byte [64];
                                CryptoMethods.GenerateRandom(key, 0, 64);
                        }
        public HMACSHA384(byte[] rgbKey)
                        {
                                HashName = "SHA384";
                                HashSizeValue = 384;
                                Key = rgbKey;
                        }

        // Destructor.
        ~HMACSHA384()
                        {
                                Dispose(false);
                        }

}; // class HMACSHA384

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: DataProtectionScope.cs ---
/*
 * DataProtectionScope.cs - Implementation of the
 *              "System.Security.Cryptography.DataProtectionScope" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

public enum DataProtectionScope
{
        CurrentUser             = 0,
        LocalMachine    = 1

}; // enum DataProtectionScope

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: RIPEMD160Managed.cs ---
/*
 * RIPEMD160Managed.cs - Implementation of the
 *              "System.Security.Cryptography.RIPEMD160Managed" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using System;
using Platform;

// Note: we use the runtime engine's implementation rather than
// write a version in C#.  This allows the system engine to be
// configured without RIPEMD160 on smaller platforms.

public class RIPEMD160Managed : RIPEMD160
{
        // Internal state from the runtime engine.
        private IntPtr state;

        // Constructor.
        public RIPEMD160Managed()
                        : base()
                        {
                                try
                                {
                                        state = 
CryptoMethods.HashNew(CryptoMethods.RIPEMD160);
                                }
                                catch(NotImplementedException)
                                {
                                        // The runtime engine does not have 
RIPEMD160 support.
                                        throw new CryptographicException
                                                (_("Crypto_NoProvider"), 
"RIPEMD160");
                                }
                        }

        // Destructor.
        ~RIPEMD160Managed()
                        {
                                Dispose(false);
                        }

        // Initialize the hash algorithm.
        public override void Initialize()
                        {
                                lock(this)
                                {
                                        if(state != IntPtr.Zero)
                                        {
                                                CryptoMethods.HashReset(state);
                                        }
                                }
                        }

        // Dispose this object.
        protected override void Dispose(bool disposing)
                        {
                                if(disposing)
                                {
                                        lock(this)
                                        {
                                                if(state != IntPtr.Zero)
                                                {
                                                        
CryptoMethods.HashFree(state);
                                                        state = IntPtr.Zero;
                                                }
                                        }
                                }
                                else if(state != IntPtr.Zero)
                                {
                                        CryptoMethods.HashFree(state);
                                        state = IntPtr.Zero;
                                }
                        }

        // Write data to the underlying hash algorithm.
        protected override void HashCore(byte[] array, int ibStart, int cbSize)
                        {
                                // Validate the parameters.
                                if(array == null)
                                {
                                        throw new 
ArgumentNullException("array");
                                }
                                else if(ibStart < 0 || ibStart > array.Length)
                                {
                                        throw new ArgumentOutOfRangeException
                                                ("ibStart", 
_("ArgRange_Array"));
                                }
                                else if(cbSize < 0 || (array.Length - ibStart) 
< cbSize)
                                {
                                        throw new 
ArgumentException(_("Arg_InvalidArrayRange"));
                                }

                                // Bail out if the runtime engine does not have 
a provider.
                                if(state == IntPtr.Zero)
                                {
                                        throw new CryptographicException
                                                (_("Crypto_NoProvider"), 
"RIPEMD160");
                                }

                                // Update the RIPEMD160 state.
                                lock(this)
                                {
                                        CryptoMethods.HashUpdate(state, array, 
ibStart, cbSize);
                                }
                        }

        // Finalize the hash and return the final hash value.
        protected override byte[] HashFinal()
                        {
                                // Bail out if the runtime engine does not have 
a provider.
                                if(state == IntPtr.Zero)
                                {
                                        throw new CryptographicException
                                                (_("Crypto_NoProvider"), 
"RIPEMD160");
                                }

                                // Compute the hash and return it.
                                byte[] hash = new byte [64];
                                lock(this)
                                {
                                        CryptoMethods.HashFinal(state, hash);
                                }
                                return hash;
                        }

}; // class RIPEMD160Managed

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

--- NEW FILE: RIPEMD160.cs ---
/*
 * RIPEMD160.cs - Implementation of the
 *                      "System.Security.Cryptography.RIPEMD160" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

using System;

public abstract class RIPEMD160 : HashAlgorithm
{
        // Constructor.
        protected RIPEMD160()
                        {
                                HashSizeValue = 128;
                        }

        // Create a new instance of the "RIPEMD160" class.
        public new static RIPEMD160 Create()
                        {
                                return (RIPEMD160)(CryptoConfig.CreateFromName
                                                (CryptoConfig.RIPEMD160Default, 
null));
                        }
        public new static RIPEMD160 Create(String algName)
                        {
                                return 
(RIPEMD160)(CryptoConfig.CreateFromName(algName, null));
                        }

}; // class RIPEMD160

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography

Index: CspProviderFlags.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/Cryptography/CspProviderFlags.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CspProviderFlags.cs 29 May 2003 01:22:41 -0000      1.2
--- CspProviderFlags.cs 28 Nov 2003 01:56:28 -0000      1.3
***************
*** 3,7 ****
   *            "System.Security.Cryptography.CspProviderFlags" class.
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 3,7 ----
   *            "System.Security.Cryptography.CspProviderFlags" class.
   *
!  * Copyright (C) 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 30,35 ****
  public enum CspProviderFlags
  {
!       UseMachineKeyStore     = 1,
!       UseDefaultKeyContainer = 2
  
  }; // enum CspProviderFlags
--- 30,38 ----
  public enum CspProviderFlags
  {
!       UseMachineKeyStore              = 0x0001,
!       UseDefaultKeyContainer  = 0x0002,
! #if CONFIG_FRAMEWORK_1_2
!       UseNonExportableKey             = 0x0004
! #endif
  
  }; // enum CspProviderFlags

--- NEW FILE: MemoryProtectionScope.cs ---
/*
 * MemoryProtectionScope.cs - Implementation of the
 *              "System.Security.Cryptography.MemoryProtectionScope" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Security.Cryptography
{

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

public enum MemoryProtectionScope
{
        SameProcess             = 0,
        CrossProcess    = 1,
        SameLogon               = 2

}; // enum MemoryProtectionScope

#endif // CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

}; // namespace System.Security.Cryptography





reply via email to

[Prev in Thread] Current Thread [Next in Thread]