public void SetFinanceKey(string financeKey) { if (FinanceKeyIsEntered && FinanceKeyIsNeeded) _tripleDesProvider = new TripleDesProvider(financeKey); }
/// <summary> /// Could have been done better with mapping, but decided to go with this route so you /// can get a more text like selection in code. /// </summary> /// <param name="ciphermode">TripleDES.CipherMode value mapped to the corresponding /// System.Security.Cryptography.CipherMode</param> /// <returns>System.Security.Cryptography.CipherMode that matches the selected /// TripleDES.CipherMode</returns> private System.Security.Cryptography.CipherMode TranslateCipherMode(TripleDesProvider.CipherMode ciphermode) { return (System.Security.Cryptography.CipherMode)Convert.ToInt32(ciphermode); }
public void ReSetFinanceKey(string financeKey) { if(string.IsNullOrEmpty(financeKey)) { FinanceKeyIsNeeded = false; FinanceKeyIsEntered = false; return; } FinanceKeyIsNeeded = true; FinanceKeyIsEntered = true; _tripleDesProvider = new TripleDesProvider(financeKey); }