public static CipherPairFile CreateRandomKeyFile(string filePath) { var cp = SymmetricCipherPair.AutogenerateRijndael(); CipherPairFile kf = new CipherPairFile(filePath, cp); kf = new CipherPairFile(filePath); return kf; }
public static CipherPairFile CreateRandomKeyFile(string filePath) { var cp = SymmetricCipherPair.AutogenerateRijndael(); CipherPairFile kf = new CipherPairFile(filePath, cp); kf = new CipherPairFile(filePath); return(kf); }
/// <summary> /// loads the cipher pair file and initializes cipher pair. if the file doesn't exist, one is generated and saved at the /// specified path. /// </summary> /// <param name="cipherPairFilePath"></param> private void InitCipherPairFile(string cipherPairFilePath) { //if the keyfile exists, we use that. if not we create one if (File.Exists(cipherPairFilePath)) { this.CipherPairFile = new CipherPairFile(cipherPairFilePath); } else { this.CipherPairFile = CipherPairFile.CreateRandomKeyFile(cipherPairFilePath); } }