Exemple #1
0
        public bool Load()
        {
            try
            {
                TextReader tr   = new StreamReader(FQFilename);
                string     json = tr.ReadToEnd();
                tr.Close();

                MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(json));
                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(KeyRegression));
                KeyRegression kr = (KeyRegression)ser.ReadObject(ms);
                ms.Close();

                MW      = kr.MW;
                current = kr.current;
                keys    = kr.keys;
                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine("Failed to load keyregression file: " + FQFilename);
                Console.WriteLine("{0} Exception caught.", e);
                return(false);
            }
        }
 public static uint GetKeyVersion(string target_dir)
 {
     KeyRegression kr = new KeyRegression(target_dir);
     return kr.GetKeyVersion();
 }
 public static Byte[] GetNewKey(string target_dir)
 {
     KeyRegression kr = new KeyRegression(target_dir);
     return kr.GetKey();
 }
 public static void GenFreshKeychain(string target_dir)
 {
     KeyRegression kr = new KeyRegression(1000, target_dir);
     kr.Flush();
 }
Exemple #5
0
 public static Byte[] KeyDer(Byte[] key)
 {
     return(KeyRegression.KeyDer(key));
 }
Exemple #6
0
 public static Byte[] GetSpecificKey(Byte[] key, uint cur_version, uint new_version)
 {
     return(KeyRegression.GetSpecific(key, cur_version - new_version));
 }
Exemple #7
0
        public static uint GetKeyVersion(string target_dir)
        {
            KeyRegression kr = new KeyRegression(target_dir);

            return(kr.GetKeyVersion());
        }
Exemple #8
0
        public static Byte[] GetNewKey(string target_dir)
        {
            KeyRegression kr = new KeyRegression(target_dir);

            return(kr.GetKey());
        }
Exemple #9
0
        public static void GenFreshKeychain(string target_dir)
        {
            KeyRegression kr = new KeyRegression(1000, target_dir);

            kr.Flush();
        }