Lines Matching refs:pkey
38 EVP_PKEY *pkey = NULL; in generate_rsa_key_long() local
87 if (EVP_PKEY_generate(genctx, &pkey) <= 0) { in generate_rsa_key_long()
96 return pkey; in generate_rsa_key_long()
110 EVP_PKEY *pkey = NULL; in generate_rsa_key_short() local
113 pkey = EVP_PKEY_Q_keygen(libctx, propq, "RSA", (size_t)bits); in generate_rsa_key_short()
115 if (pkey == NULL) in generate_rsa_key_short()
118 return pkey; in generate_rsa_key_short()
124 static int dump_key(const EVP_PKEY *pkey) in dump_key() argument
137 if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_N, &n) == 0) { in dump_key()
146 if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_E, &e) == 0) { in dump_key()
155 if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_D, &d) == 0) { in dump_key()
164 if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_FACTOR1, &p) == 0) { in dump_key()
177 if (EVP_PKEY_get_bn_param(pkey, OSSL_PKEY_PARAM_RSA_FACTOR2, &q) == 0) { in dump_key()
185 if (EVP_PKEY_get_int_param(pkey, OSSL_PKEY_PARAM_BITS, &bits) == 0) { in dump_key()
215 if (PEM_write_PUBKEY(stdout, pkey) == 0) { in dump_key()
225 if (PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL) == 0) { in dump_key()
244 EVP_PKEY *pkey = NULL; in main() local
271 pkey = generate_rsa_key_short(libctx, bits); in main()
273 pkey = generate_rsa_key_long(libctx, bits); in main()
275 if (pkey == NULL) in main()
279 if (dump_key(pkey) == 0) { in main()
286 EVP_PKEY_free(pkey); in main()