Lines Matching refs:out

42 static int dh_to_text(BIO *out, const void *key, int selection)  in DEFINE_SPECIAL_STACK_OF_CONST()
51 if (out == NULL || dh == NULL) { in DEFINE_SPECIAL_STACK_OF_CONST()
91 if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0) in DEFINE_SPECIAL_STACK_OF_CONST()
94 && !ossl_bio_print_labeled_bignum(out, "private-key:", priv_key)) in DEFINE_SPECIAL_STACK_OF_CONST()
97 && !ossl_bio_print_labeled_bignum(out, "public-key:", pub_key)) in DEFINE_SPECIAL_STACK_OF_CONST()
100 && !ossl_bio_print_ffc_params(out, params)) in DEFINE_SPECIAL_STACK_OF_CONST()
104 && BIO_printf(out, "recommended-private-length: %ld bits\n", in DEFINE_SPECIAL_STACK_OF_CONST()
115 static int dsa_to_text(BIO *out, const void *key, int selection) in dsa_to_text() argument
123 if (out == NULL || dsa == NULL) { in dsa_to_text()
163 if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0) in dsa_to_text()
166 && !ossl_bio_print_labeled_bignum(out, "priv:", priv_key)) in dsa_to_text()
169 && !ossl_bio_print_labeled_bignum(out, "pub: ", pub_key)) in dsa_to_text()
172 && !ossl_bio_print_ffc_params(out, params)) in dsa_to_text()
182 static int ec_param_explicit_curve_to_text(BIO *out, const EC_GROUP *group, in ec_param_explicit_curve_to_text() argument
200 || BIO_printf(out, "Basis Type: %s\n", OBJ_nid2sn(basis_type)) <= 0) in ec_param_explicit_curve_to_text()
204 return ossl_bio_print_labeled_bignum(out, plabel, p) in ec_param_explicit_curve_to_text()
205 && ossl_bio_print_labeled_bignum(out, "A: ", a) in ec_param_explicit_curve_to_text()
206 && ossl_bio_print_labeled_bignum(out, "B: ", b); in ec_param_explicit_curve_to_text()
209 static int ec_param_explicit_gen_to_text(BIO *out, const EC_GROUP *group, in ec_param_explicit_gen_to_text() argument
243 ret = ossl_bio_print_labeled_buf(out, glabel, buf, buflen); in ec_param_explicit_gen_to_text()
249 static int ec_param_explicit_to_text(BIO *out, const EC_GROUP *group, in ec_param_explicit_to_text() argument
274 if (BIO_printf(out, "Field Type: %s\n", OBJ_nid2sn(tmp_nid)) <= 0 in ec_param_explicit_to_text()
275 || !ec_param_explicit_curve_to_text(out, group, ctx) in ec_param_explicit_to_text()
276 || !ec_param_explicit_gen_to_text(out, group, ctx) in ec_param_explicit_to_text()
277 || !ossl_bio_print_labeled_bignum(out, "Order: ", order) in ec_param_explicit_to_text()
279 && !ossl_bio_print_labeled_bignum(out, "Cofactor: ", cofactor)) in ec_param_explicit_to_text()
281 && !ossl_bio_print_labeled_buf(out, "Seed:", seed, seed_len))) in ec_param_explicit_to_text()
290 static int ec_param_to_text(BIO *out, const EC_GROUP *group, in ec_param_to_text() argument
301 if (BIO_printf(out, "%s: %s\n", "ASN1 OID", OBJ_nid2sn(curve_nid)) <= 0) in ec_param_to_text()
306 || BIO_printf(out, "%s: %s\n", "NIST CURVE", curve_name) > 0); in ec_param_to_text()
308 return ec_param_explicit_to_text(out, group, libctx); in ec_param_to_text()
312 static int ec_to_text(BIO *out, const void *key, int selection) in ec_to_text() argument
321 if (out == NULL || ec == NULL) { in ec_to_text()
364 && BIO_printf(out, "%s: (%d bit)\n", type_label, in ec_to_text()
368 && !ossl_bio_print_labeled_buf(out, "priv:", priv, priv_len)) in ec_to_text()
371 && !ossl_bio_print_labeled_buf(out, "pub:", pub, pub_len)) in ec_to_text()
374 ret = ec_param_to_text(out, group, ossl_ec_key_get_libctx(ec)); in ec_to_text()
385 static int ecx_to_text(BIO *out, const void *key, int selection) in ecx_to_text() argument
390 if (out == NULL || ecx == NULL) { in ecx_to_text()
416 if (BIO_printf(out, "%s Private-Key:\n", type_label) <= 0) in ecx_to_text()
418 if (!ossl_bio_print_labeled_buf(out, "priv:", ecx->privkey, ecx->keylen)) in ecx_to_text()
427 if (BIO_printf(out, "%s Public-Key:\n", type_label) <= 0) in ecx_to_text()
431 if (!ossl_bio_print_labeled_buf(out, "pub:", ecx->pubkey, ecx->keylen)) in ecx_to_text()
441 static int ml_kem_to_text(BIO *out, const void *vkey, int selection) in ml_kem_to_text() argument
443 return ossl_ml_kem_key_to_text(out, (ML_KEM_KEY *)vkey, selection); in ml_kem_to_text()
450 static int slh_dsa_to_text(BIO *out, const void *key, int selection) in slh_dsa_to_text() argument
452 return ossl_slh_dsa_key_to_text(out, (SLH_DSA_KEY *)key, selection); in slh_dsa_to_text()
456 static int rsa_to_text(BIO *out, const void *key, int selection) in rsa_to_text() argument
470 if (out == NULL || rsa == NULL) { in rsa_to_text()
499 if (BIO_printf(out, "%s: (%d bit, %d primes)\n", in rsa_to_text()
503 if (BIO_printf(out, "%s: (%d bit)\n", in rsa_to_text()
508 if (!ossl_bio_print_labeled_bignum(out, modulus_label, rsa_n)) in rsa_to_text()
510 if (!ossl_bio_print_labeled_bignum(out, exponent_label, rsa_e)) in rsa_to_text()
515 if (!ossl_bio_print_labeled_bignum(out, "privateExponent:", rsa_d)) in rsa_to_text()
517 if (!ossl_bio_print_labeled_bignum(out, "prime1:", in rsa_to_text()
520 if (!ossl_bio_print_labeled_bignum(out, "prime2:", in rsa_to_text()
523 if (!ossl_bio_print_labeled_bignum(out, "exponent1:", in rsa_to_text()
526 if (!ossl_bio_print_labeled_bignum(out, "exponent2:", in rsa_to_text()
529 if (!ossl_bio_print_labeled_bignum(out, "coefficient:", in rsa_to_text()
533 if (BIO_printf(out, "prime%d:", i + 1) <= 0) in rsa_to_text()
535 if (!ossl_bio_print_labeled_bignum(out, NULL, in rsa_to_text()
538 if (BIO_printf(out, "exponent%d:", i + 1) <= 0) in rsa_to_text()
540 if (!ossl_bio_print_labeled_bignum(out, NULL, in rsa_to_text()
543 if (BIO_printf(out, "coefficient%d:", i + 1) <= 0) in rsa_to_text()
545 if (!ossl_bio_print_labeled_bignum(out, NULL, in rsa_to_text()
555 if (BIO_printf(out, "(INVALID PSS PARAMETERS)\n") <= 0) in rsa_to_text()
561 if (BIO_printf(out, "No PSS parameter restrictions\n") <= 0) in rsa_to_text()
573 if (BIO_printf(out, "PSS parameter restrictions:\n") <= 0) in rsa_to_text()
575 if (BIO_printf(out, " Hash Algorithm: %s%s\n", in rsa_to_text()
580 if (BIO_printf(out, " Mask Algorithm: %s with %s%s\n", in rsa_to_text()
587 if (BIO_printf(out, " Minimum Salt Length: %d%s\n", in rsa_to_text()
591 if (BIO_printf(out, " Trailer Field: 0x%x%s\n", in rsa_to_text()
611 static int ml_dsa_to_text(BIO *out, const void *key, int selection) in ml_dsa_to_text() argument
613 return ossl_ml_dsa_key_to_text(out, (ML_DSA_KEY *)key, selection); in ml_dsa_to_text()
629 int (*key2text)(BIO *out, const void *key, in key2text_encode() argument
633 BIO *out = ossl_bio_new_from_core_bio(vctx, cout); in key2text_encode() local
636 if (out == NULL) in key2text_encode()
639 ret = key2text(out, key, selection); in key2text_encode()
640 BIO_free(out); in key2text_encode()