public void SetCertificateVerify(VerifyMode mode, RemoteValidationCallback callback) { this.managed_cert_callback = callback; if (callback != null) { verify_callback = new VerifyCallback(OnVerifyCallback); } native_openssl_set_certificate_verify(handle, (int)mode, verify_callback, null, 10); }
public void Verify(string verifier, VerifyCallback callback) { verifyQuery["idvGivenAnswer"] = verifier; var verifyUrl = "https://accounts.google.com/b/0/IdvVerify?idvContinueHandler=SERVICE&service=ah"; var cl = new WebClientWithCookies(); cl.UploadValuesAsync(new Uri(verifyUrl), verifyQuery); cl.UploadValuesCompleted += (s, o) => { var html = Encoding.UTF8.GetString(o.Result); callback(!html.Contains("\"idvGivenAnswer\"")); }; }
public async Task HandleAsync(IUpdateContext context, UpdateDelegate next, CancellationToken cancellationToken) { _telegramService = new TelegramService(context); CallbackQuery cq = context.Update.CallbackQuery; _telegramService.CallBackMessageId = cq.Message.MessageId; Log.Information("CallbackQuery" + cq.ToJson(true)); // Log.Information($"CallBackData: {cq.Data}"); var partsCallback = cq.Data.SplitText(" "); Log.Information($"Callbacks: {partsCallback.ToJson()}"); switch (partsCallback[0]) // Level 0 { case "action": var callbackResult = new ActionCallback(_telegramService); Log.Information($"ActionResult: {callbackResult.ToJson(true)}"); break; case "help": var helpCallback = new HelpCallback(_telegramService); Log.Information($"HelpResult: {helpCallback.ToJson(true)}"); break; case "setting": var settingsCallback = new SettingsCallback(_telegramService); Log.Information($"SettingsResult: {settingsCallback.ToJson(true)}"); break; case "verify": var verifyCallback = new VerifyCallback(_telegramService); Log.Information($"VerifyResult: {verifyCallback.ToJson(true)}"); break; } // await context.Bot.Client.AnswerCallbackQueryAsync(cq.Id, "PONG", true); await next(context, cancellationToken) .ConfigureAwait(false); }
public void SetCertificateVerify (VerifyMode mode, RemoteValidationCallback callback) { this.managed_cert_callback = callback; if (callback != null) verify_callback = new VerifyCallback (OnVerifyCallback); native_openssl_set_certificate_verify (handle, (int)mode, verify_callback, null, 10); }
extern static void native_openssl_set_certificate_verify (OpenSslHandle handle, int mode, VerifyCallback verify_cb, CertificateVerifyCallback cert_cb, int depth);
public void Verify(string verifier, VerifyCallback callback) { verifyQuery["idvGivenAnswer"] = verifier; var verifyUrl = "https://accounts.google.com/b/0/IdvVerify?idvContinueHandler=SERVICE&service=ah"; var cl = new WebClientWithCookies(); cl.UploadValuesAsync(new Uri(verifyUrl), verifyQuery); cl.UploadValuesCompleted += (s, o) => { var html = o.Error == null ? Encoding.UTF8.GetString(o.Result) : ""; callback(!html.Contains("\"idvGivenAnswer\"")); }; }
extern static void native_openssl_set_certificate_verify(OpenSslHandle handle, int mode, VerifyCallback verify_cb, CertificateVerifyCallback cert_cb, int depth);
private static extern bool Initialize(ErrorCallback errorCb, HashCalculatedCallback hashCaclCb, VerifyCallback verifyCb, int threadsCount);