コード例 #1
0
        public static void saveEcKey(EcKey ecKey)
        {
            byte[]     bytes = ecKey.ToAsn1();
            FileStream fs    = new FileStream(PRIV_KEY_FILENAME, FileMode.Create, FileAccess.Write);

            fs.Write(bytes, 0, bytes.Length);
            fs.Close();
        }
コード例 #2
0
        public static void saveEcKey(EcKey ecKey, string path)
        {
            byte[]     bytes = ecKey.ToAsn1();
            FileStream fs    = new FileStream(path, FileMode.Create, FileAccess.Write);

            fs.Write(bytes, 0, bytes.Length);
            fs.Close();
        }
コード例 #3
0
        public static void saveEcKey(EcKey ecKey)
        {
            byte[]     bytes = ecKey.ToAsn1();
            FileStream fs    = new FileStream(GetPrivateKeyFullName(), FileMode.Create, FileAccess.Write);

            fs.Write(bytes, 0, bytes.Length);
            fs.Close();
        }
コード例 #4
0
        public static async Task SaveEcKey(EcKey ecKey)
        {
            var bytes = ecKey.ToAsn1();

            if (!Directory.Exists(BitPay.TokensFolder))
            {
                Directory.CreateDirectory(BitPay.TokensFolder);
            }
            using (var fs = new FileStream(PrivateKeyFilename, FileMode.Create, FileAccess.Write)) {
                await fs.WriteAsync(bytes, 0, bytes.Length);
            }
        }
コード例 #5
0
        public static async Task SaveEcKey(EcKey ecKey)
        {
            var bytes = ecKey.ToAsn1();

            if (!string.IsNullOrEmpty(Path.GetDirectoryName(PrivateKeyFile)) && !Directory.Exists(Path.GetDirectoryName(PrivateKeyFile)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(PrivateKeyFile));
            }
            using (var fs = new FileStream(PrivateKeyFile, FileMode.Create, FileAccess.Write))
            {
                await fs.WriteAsync(bytes, 0, bytes.Length);
            }
        }