Changeset 1737 for trunk/sources/HeuristicLab.Security.Contracts
- Timestamp:
- 05/04/09 19:42:18 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Security.Contracts/3.2
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Security.Contracts/3.2/BusinessObjects/User.cs
r1656 r1737 24 24 using System.Text; 25 25 using System.Runtime.Serialization; 26 using System.Security.Cryptography; 26 27 27 28 namespace HeuristicLab.Security.Contracts.BusinessObjects { … … 29 30 [DataContract] 30 31 public class User : PermissionOwner { 32 private static string getMd5Hash(string input) { 33 // Create a new instance of the MD5CryptoServiceProvider object. 34 MD5 md5Hasher = MD5.Create(); 35 36 // Convert the input string to a byte array and compute the hash. 37 byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input)); 38 39 // Create a new Stringbuilder to collect the bytes 40 // and create a string. 41 StringBuilder sBuilder = new StringBuilder(); 42 43 // Loop through each byte of the hashed data 44 // and format each one as a hexadecimal string. 45 for (int i = 0; i < data.Length; i++) { 46 sBuilder.Append(data[i].ToString("x2")); 47 } 48 49 // Return the hexadecimal string. 50 return sBuilder.ToString(); 51 } 52 53 31 54 [DataMember] 32 55 public String Login { get; set; } 56 57 private String password; 58 33 59 [DataMember] 34 public String Password { get; set; } 60 public String Password { 61 get { 62 return this.password; 63 } 64 set { 65 this.password = getMd5Hash(value); 66 } 67 } 68 69 public void SetPlainPassword(String password) { 70 this.password = password; 71 } 72 35 73 [DataMember] 36 74 public String MailAddress { get; set; } -
trunk/sources/HeuristicLab.Security.Contracts/3.2/Interfaces/IPermissionManager.cs
r1735 r1737 19 19 void EndSession(Guid sessionId); 20 20 21 [OperationContract]22 [FaultContractAttribute(typeof(CommunicationException))]23 void TestServer();24 21 } 25 22 }
Note: See TracChangeset
for help on using the changeset viewer.