Exemplo n.º 1
0
 public TicketData DecryptTicket(string cipherText) { 
     var arr = _encryptionService.Decrypt(cipherText).Split(Seperator);
     if (arr.Length != 3)
         throw new KatushaTicketException(cipherText);
     var ticketData = new TicketData {LoginDate = DateTime.Parse(arr[0]), Guid = Guid.Parse(arr[1]), UserRole = long.Parse(arr[2])};
     return ticketData;
 }
Exemplo n.º 2
0
 public string EncryptTicket(TicketData ticketData) { return _encryptionService.Encrypt(ticketData.LoginDate.ToString(CultureInfo.InvariantCulture) + Seperator + ticketData.Guid + Seperator + ticketData.UserRole); }