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(); }
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(); }
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(); }
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); } }
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); } }