public byte[] GenerateNotaryCertificate(Certificate notaryCertificate) { SignCheckCookie cookie = new SignCheckCookie(); Signed<SignCheckCookie> signedCookie = new Signed<SignCheckCookie>(cookie, notaryCertificate); Begin(); Status.VotingClient.GenerateSignCheck(signedCookie, GenerateSignCheckComplete); if (!WaitForCompletion()) { throw this.exception; } byte[] code = notaryCertificate.Decrypt(this.encryptedCode); return code; }
private void GenerateSignCheck() { if (DecryptPrivateKeyDialog.TryDecryptIfNessecary(Status.Certificate, GuiResources.UnlockActionGenerateSignCheck)) { SignCheckCookie cookie = new SignCheckCookie(); Signed<SignCheckCookie> signedCookie = new Signed<SignCheckCookie>(cookie, Status.Certificate); this.run = true; SetGuiEnable(false); Status.VotingClient.GenerateSignCheck(signedCookie, GenerateSignCheckComplete); while (this.run) { Status.UpdateProgress(); Thread.Sleep(10); } Status.UpdateProgress(); if (this.exception == null) { byte[] code = Status.Certificate.Decrypt(this.encryptedCode); GenerateSignCheckDialog.ShowSignCheck(Status.Certificate.Id, code); RefreshList(); } else { Status.SetMessage(this.exception.Message, MessageType.Error); } SetGuiEnable(true); } }