MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / http_remove_key

Method http_remove_key

runners/key-manager/KeyManagerRunner.cpp:482–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482std::string KeyManagerRunner::http_remove_key(std::string pub_key) {
483 auto R = td::hex_decode(pub_key);
484 if (R.is_error()) {
485 return wrap_short_answer_to_http(PSTRING() << "cannot decode hex: " << R.move_as_error());
486 }
487 auto r = R.move_as_ok();
488 if (r.size() != 32) {
489 return wrap_short_answer_to_http(PSTRING() << "cannot decode hex: public key must be 32 bytes long");
490 }
491 td::Bits256 p;
492 p.as_slice().copy_from(r);
493 remove_key(p);
494 return wrap_short_answer_to_http(PSTRING() << "key removed");
495}
496
497std::string KeyManagerRunner::http_generate_key(std::string key_type) {
498 if (key_type == "") {

Callers

nothing calls this directly

Calls 1

as_sliceMethod · 0.80

Tested by

no test coverage detected