EldoS | Feel safer!

Software components for data protection, secure storage and transfer

GenerateAsync

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#27599
Posted: 12/09/2013 06:34:57
by Christian Hermann (Basic support level)
Joined: 09/20/2013
Posts: 17

Hello,

is there a way to Cancel the following Method with a CancellationToken?


Code

SecretKey = new TElPGPSecretKey();

await SecretKey.GenerateAsync(passphrase, bits, SBPGPConstants.Unit.SB_PGP_ALGORITHM_PK_RSA, username, false, 0);


Or maybe you have a complete Example for async PGP generation with C# .NET?


Kind reagards
#27600
Posted: 12/09/2013 06:41:12
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

You can use TElPGPSecretKey.BeginGenerate/EndGenerate/AsyncOperationFinished methods for asynchronious keys generation.
#27601
Posted: 12/09/2013 06:47:53
by Christian Hermann (Basic support level)
Joined: 09/20/2013
Posts: 17

Okay,

so GenerateAsync is not recommended?
#27602
Posted: 12/09/2013 06:51:26
by Ken Ivanov (EldoS Corp.)

Hello Christian,

I am afraid CancellationToken-based cancellation of the key generation procedure is not supported at the moment. Please use the SBB-based asynchronous methods that Vsevolod suggested (BeginGenerate() method to initiate the generation and CancelGeneration() to cancel it) instead to control the lifetime of the generation procedure.
#27603
Posted: 12/09/2013 06:54:25
by Ken Ivanov (EldoS Corp.)

Christian,

We can't say that GenerateAsync() is 'not recommended', as it does work and is completely usable within the use cases where no forceful termination of the generation procedure is needed. Yet, if you need to be able to cancel the generation in its progress, the BeginGenerate() and CancelGeneration() methods are the ones to use.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 600 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!