Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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\""));
            };
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
		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);
		}
Esempio n. 5
0
		extern static void native_openssl_set_certificate_verify (OpenSslHandle handle, int mode, VerifyCallback verify_cb, CertificateVerifyCallback cert_cb, int depth);
Esempio n. 6
0
        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\""));
            };
        }
Esempio n. 7
0
 extern static void native_openssl_set_certificate_verify(OpenSslHandle handle, int mode, VerifyCallback verify_cb, CertificateVerifyCallback cert_cb, int depth);
Esempio n. 8
0
 private static extern bool Initialize(ErrorCallback errorCb, HashCalculatedCallback hashCaclCb, VerifyCallback verifyCb, int threadsCount);