MCPcopy Create free account
hub / github.com/apache/httpd / md_pkey_spec_to_json

Function md_pkey_spec_to_json

modules/md/md_crypt.c:378–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378md_json_t *md_pkey_spec_to_json(const md_pkey_spec_t *spec, apr_pool_t *p)
379{
380 md_json_t *json = md_json_create(p);
381 if (json) {
382 switch (spec->type) {
383 case MD_PKEY_TYPE_DEFAULT:
384 md_json_sets("Default", json, MD_KEY_TYPE, NULL);
385 break;
386 case MD_PKEY_TYPE_RSA:
387 md_json_sets("RSA", json, MD_KEY_TYPE, NULL);
388 if (spec->params.rsa.bits >= MD_PKEY_RSA_BITS_MIN) {
389 md_json_setl((long)spec->params.rsa.bits, json, MD_KEY_BITS, NULL);
390 }
391 break;
392 case MD_PKEY_TYPE_EC:
393 md_json_sets("EC", json, MD_KEY_TYPE, NULL);
394 if (spec->params.ec.curve) {
395 md_json_sets(spec->params.ec.curve, json, MD_KEY_CURVE, NULL);
396 }
397 break;
398 default:
399 md_json_sets("Unsupported", json, MD_KEY_TYPE, NULL);
400 break;
401 }
402 }
403 return json;
404}
405
406static apr_status_t spec_to_json(void *value, md_json_t *json, apr_pool_t *p, void *baton)
407{

Callers 2

spec_to_jsonFunction · 0.85
md_pkeys_spec_to_jsonFunction · 0.85

Calls 3

md_json_createFunction · 0.85
md_json_setsFunction · 0.85
md_json_setlFunction · 0.85

Tested by

no test coverage detected