//---------------------------------------------------------------------------------------------------- private static void GenerateRSAKeys(UserSessionServer userInfo) { var rsa = RSALogic.GetNew_RSAProvider(); userInfo.RSA_PublicKey_PEM = RSALogic.Get_PublicPEM(rsa); userInfo.Set__RSA_PrivateKey_XML(RSALogic.Get_PrivateXML(rsa)); }
//---------------------------------------------------------------------------------------------------- public static bool CaptureAESKey(string aesIndex, string base64) { AjaxService.ASPdatabaseService.GetSetVal(); var user = UserSessionLogic.GetUser(); string aes_JSON = RSALogic.Decrypt(user.Get__RSA_PrivateKey_XML(), base64); var aesKeyInfo = (new JavaScriptSerializer()).Deserialize <AESKeyInfo>(aes_JSON); if (!user.AESKeysDict.ContainsKey(aesIndex)) { user.AESKeysDict.Add(aesIndex, aesKeyInfo); } return(true); }