EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Posted: 12/09/2013 06:34:57
by Christian Hermann (Basic support level)
Joined: 09/20/2013
Posts: 17


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


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
Posted: 12/09/2013 06:41:12
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

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


so GenerateAsync is not recommended?
Posted: 12/09/2013 06:51:26
by Ken Ivanov (Team)

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.
Posted: 12/09/2013 06:54:25
by Ken Ivanov (Team)


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.



Topic viewed 681 times

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


Back to top

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

Got it!