private CredentialCookie deserialize_cookie(string value) { var cryptography = new O7Cryptography(Constant.CRYPTO_KEY); var dencryptedValue = cryptography.Decrypt(value); return(O7JsonSerealizer.Deserialize <CredentialCookie>(dencryptedValue)); }
private string serialize_cookie(string login, string password, string companyId, string branchId, string name) { var cookieValue = new CredentialCookie(login, password, companyId, branchId, name); var serializedValue = O7JsonSerealizer.Serialize(cookieValue); var cryptography = new O7Cryptography(Constant.CRYPTO_KEY); return(cryptography.Encrypt(serializedValue)); }
public SecurityController() { _cryptography = new O7Cryptography(Constant.CRYPTO_KEY); }