mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 00:16:27 +00:00
Re-added null checks
This commit is contained in:
parent
ed14082b9a
commit
2bed3eb47f
@ -35,6 +35,9 @@ namespace CryptoExchange.Net.Authentication
|
|||||||
/// <param name="privateKey">The private key used for signing</param>
|
/// <param name="privateKey">The private key used for signing</param>
|
||||||
public ApiCredentials(string privateKey)
|
public ApiCredentials(string privateKey)
|
||||||
{
|
{
|
||||||
|
if(string.IsNullOrEmpty(privateKey))
|
||||||
|
throw new ArgumentException("Private key can't be null/empty");
|
||||||
|
|
||||||
var securePrivateKey = new SecureString();
|
var securePrivateKey = new SecureString();
|
||||||
foreach (var c in privateKey)
|
foreach (var c in privateKey)
|
||||||
securePrivateKey.AppendChar(c);
|
securePrivateKey.AppendChar(c);
|
||||||
@ -59,6 +62,9 @@ namespace CryptoExchange.Net.Authentication
|
|||||||
/// <param name="privateKey">The private key used for signing</param>
|
/// <param name="privateKey">The private key used for signing</param>
|
||||||
public ApiCredentials(string key, string secret)
|
public ApiCredentials(string key, string secret)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(secret))
|
||||||
|
throw new ArgumentException("Key and secret can't be null/empty");
|
||||||
|
|
||||||
var secureApiKey = new SecureString();
|
var secureApiKey = new SecureString();
|
||||||
foreach (var c in key)
|
foreach (var c in key)
|
||||||
secureApiKey.AppendChar(c);
|
secureApiKey.AppendChar(c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user