public async Task <PrivateKeyDetails> GenerateAddressAsync(string label = null, bool isPublic = true) { var key = new ECKey(); var details = new PrivateKeyDetails(key, label); await ImportKeyAsync(details); return(details); }
public async Task ImportKeyAsync(PrivateKeyDetails key, bool isPublic = true) { if (IsLocked) { throw new LockedException(); } if (isPublic) { await ImportReadOnlyAddressAsync(key); } await privateKeyLock.WaitAsync(); try { PrivateKeys.Add(key); } finally { privateKeyLock.Release(); } await SaveAsync(); }
public async Task ImportKeyAsync(PrivateKeyDetails key, bool isPublic = true) { if(IsLocked) throw new LockedException(); if(isPublic) await ImportReadOnlyAddressAsync(key); await privateKeyLock.WaitAsync(); try { PrivateKeys.Add(key); } finally { privateKeyLock.Release(); } await SaveAsync(); }
public async Task<PrivateKeyDetails> GenerateAddressAsync(string label = null, bool isPublic = true) { var key = new ECKey(); var details = new PrivateKeyDetails(key, label); await ImportKeyAsync(details); return details; }