Lines Matching refs:key
148 static int write_private_key( mbedtls_pk_context *key, const char *output_file ) in write_private_key() argument
159 if( ( ret = mbedtls_pk_write_key_pem( key, output_buf, 16000 ) ) != 0 ) in write_private_key()
166 if( ( ret = mbedtls_pk_write_key_der( key, output_buf, 16000 ) ) < 0 ) in write_private_key()
190 mbedtls_pk_context key; in main() local
204 mbedtls_pk_init( &key ); in main()
316 if( ( ret = mbedtls_pk_setup( &key, mbedtls_pk_info_from_type( opt.type ) ) ) != 0 ) in main()
325 ret = mbedtls_rsa_gen_key( mbedtls_pk_rsa( key ), mbedtls_ctr_drbg_random, &ctr_drbg, in main()
338 ret = mbedtls_ecp_gen_key( opt.ec_curve, mbedtls_pk_ec( key ), in main()
359 if( mbedtls_pk_get_type( &key ) == MBEDTLS_PK_RSA ) in main()
361 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( key ); in main()
374 if( mbedtls_pk_get_type( &key ) == MBEDTLS_PK_ECKEY ) in main()
376 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( key ); in main()
392 if( ( ret = write_private_key( &key, opt.filename ) ) != 0 ) in main()
412 mbedtls_pk_free( &key ); in main()