Ejemplo n.º 1
0
        public KeySet Generate()
        {
            var keys = new KeySet();

            keys.DeviceKey  = GenerateKey();
            keys.PrivateKey = GenerateKey();
            keys.IpfsKey    = GenerateKey();

            return(keys);
        }
Ejemplo n.º 2
0
        public void Save(KeySet keys)
        {
            if (!Directory.Exists(DataFolder))
            {
                Directory.CreateDirectory(DataFolder);
            }

            var output = String.Format("Device:{0}\nPrivate:{1};\nIpfs:{2}", keys.DeviceKey, keys.PrivateKey, keys.IpfsKey);

            var filePath = GetKeySetFilePath(keys);

            File.WriteAllText(filePath, output);
        }
Ejemplo n.º 3
0
 public string GetKeySetFilePath(KeySet keys)
 {
     return(Path.Combine(DataFolder, keys.IpfsKey));
 }