/net-tools-3.7.0/mbedtls-2.4.0/tests/suites/ |
D | test_suite_pk.function | 2 #include "mbedtls/pk.h" 13 static int pk_genkey( mbedtls_pk_context *pk ) 15 ((void) pk); 18 if( mbedtls_pk_get_type( pk ) == MBEDTLS_PK_RSA ) 19 return mbedtls_rsa_gen_key( mbedtls_pk_rsa( *pk ), rnd_std_rand, NULL, RSA_KEY_SIZE, 3 ); 22 if( mbedtls_pk_get_type( pk ) == MBEDTLS_PK_ECKEY || 23 mbedtls_pk_get_type( pk ) == MBEDTLS_PK_ECKEY_DH || 24 mbedtls_pk_get_type( pk ) == MBEDTLS_PK_ECDSA ) 27 if( ( ret = mbedtls_ecp_group_load( &mbedtls_pk_ec( *pk )->grp, 31 return mbedtls_ecp_gen_keypair( &mbedtls_pk_ec( *pk )->grp, &mbedtls_pk_ec( *pk )->d, [all …]
|
D | test_suite_pkparse.function | 2 #include "mbedtls/pk.h" 119 mbedtls_pk_context pk; 125 mbedtls_pk_init( &pk ); 132 TEST_ASSERT( mbedtls_pk_parse_key( &pk, buf, data_len, NULL, 0 ) == ( result ) ); 139 mbedtls_pk_free( &pk );
|
D | test_suite_pkwrite.function | 2 #include "mbedtls/pk.h"
|
/net-tools-3.7.0/mbedtls-2.4.0/programs/test/ |
D | ssl_cert_test.c | 139 mbedtls_pk_context pk; in main() local 142 mbedtls_pk_init( &pk ); in main() 193 ret = mbedtls_pk_parse_keyfile( &pk, name, NULL ); in main() 210 if( ! mbedtls_pk_can_do( &clicert.pk, MBEDTLS_PK_RSA ) ) in main() 217 ret = mbedtls_mpi_cmp_mpi(&mbedtls_pk_rsa( pk )->N, &mbedtls_pk_rsa( clicert.pk )->N); in main() 224 ret = mbedtls_mpi_cmp_mpi(&mbedtls_pk_rsa( pk )->E, &mbedtls_pk_rsa( clicert.pk )->E); in main() 231 ret = mbedtls_rsa_check_privkey( mbedtls_pk_rsa( pk ) ); in main() 241 mbedtls_pk_free( &pk ); in main()
|
/net-tools-3.7.0/mbedtls-2.4.0/programs/pkey/ |
D | key_app.c | 87 mbedtls_pk_context pk; in main() local 95 mbedtls_pk_init( &pk ); in main() 174 ret = mbedtls_pk_parse_keyfile( &pk, opt.filename, opt.password ); in main() 189 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) in main() 191 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); in main() 204 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY ) in main() 206 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk ); in main() 227 ret = mbedtls_pk_parse_public_keyfile( &pk, opt.filename ); in main() 239 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) in main() 241 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); in main() [all …]
|
D | rsa_verify_pss.c | 64 mbedtls_pk_context pk; in main() local 69 mbedtls_pk_init( &pk ); in main() 85 if( ( ret = mbedtls_pk_parse_public_keyfile( &pk, argv[1] ) ) != 0 ) in main() 92 if( !mbedtls_pk_can_do( &pk, MBEDTLS_PK_RSA ) ) in main() 99 mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ), MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA256 ); in main() 133 if( ( ret = mbedtls_pk_verify( &pk, MBEDTLS_MD_SHA256, hash, 0, in main() 145 mbedtls_pk_free( &pk ); in main()
|
D | rsa_sign_pss.c | 64 mbedtls_pk_context pk; in main() local 74 mbedtls_pk_init( &pk ); in main() 102 if( ( ret = mbedtls_pk_parse_keyfile( &pk, argv[1], "" ) ) != 0 ) in main() 110 if( !mbedtls_pk_can_do( &pk, MBEDTLS_PK_RSA ) ) in main() 117 mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ), MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA256 ); in main() 134 if( ( ret = mbedtls_pk_sign( &pk, MBEDTLS_MD_SHA256, hash, 0, buf, &olen, in main() 165 mbedtls_pk_free( &pk ); in main()
|
D | pk_verify.c | 60 mbedtls_pk_context pk; in main() local 65 mbedtls_pk_init( &pk ); in main() 81 if( ( ret = mbedtls_pk_parse_public_keyfile( &pk, argv[1] ) ) != 0 ) in main() 119 if( ( ret = mbedtls_pk_verify( &pk, MBEDTLS_MD_SHA256, hash, 0, in main() 131 mbedtls_pk_free( &pk ); in main()
|
D | pk_sign.c | 63 mbedtls_pk_context pk; in main() local 74 mbedtls_pk_init( &pk ); in main() 101 if( ( ret = mbedtls_pk_parse_keyfile( &pk, argv[1], "" ) ) != 0 ) in main() 123 if( ( ret = mbedtls_pk_sign( &pk, MBEDTLS_MD_SHA256, hash, 0, buf, &olen, in main() 154 mbedtls_pk_free( &pk ); in main()
|
D | pk_decrypt.c | 64 mbedtls_pk_context pk; in main() local 102 mbedtls_pk_init( &pk ); in main() 104 if( ( ret = mbedtls_pk_parse_keyfile( &pk, argv[1], "" ) ) != 0 ) in main() 135 if( ( ret = mbedtls_pk_decrypt( &pk, buf, i, result, &olen, sizeof(result), in main()
|
D | pk_encrypt.c | 64 mbedtls_pk_context pk; in main() local 100 mbedtls_pk_init( &pk ); in main() 102 if( ( ret = mbedtls_pk_parse_public_keyfile( &pk, argv[1] ) ) != 0 ) in main() 122 if( ( ret = mbedtls_pk_encrypt( &pk, input, strlen( argv[2] ), in main()
|
/net-tools-3.7.0/mbedtls-2.4.0/library/ |
D | pkparse.c | 580 mbedtls_pk_context *pk ) in mbedtls_pk_parse_subpubkey() argument 609 if( ( ret = mbedtls_pk_setup( pk, pk_info ) ) != 0 ) in mbedtls_pk_parse_subpubkey() 615 ret = pk_get_rsapubkey( p, end, mbedtls_pk_rsa( *pk ) ); in mbedtls_pk_parse_subpubkey() 621 ret = pk_use_ecparams( &alg_params, &mbedtls_pk_ec( *pk )->grp ); in mbedtls_pk_parse_subpubkey() 623 ret = pk_get_ecpubkey( p, end, mbedtls_pk_ec( *pk ) ); in mbedtls_pk_parse_subpubkey() 633 mbedtls_pk_free( pk ); in mbedtls_pk_parse_subpubkey() 849 mbedtls_pk_context *pk, in pk_parse_key_pkcs8_unencrypted_der() argument 904 if( ( ret = mbedtls_pk_setup( pk, pk_info ) ) != 0 ) in pk_parse_key_pkcs8_unencrypted_der() 910 if( ( ret = pk_parse_key_pkcs1_der( mbedtls_pk_rsa( *pk ), p, len ) ) != 0 ) in pk_parse_key_pkcs8_unencrypted_der() 912 mbedtls_pk_free( pk ); in pk_parse_key_pkcs8_unencrypted_der() [all …]
|
D | x509_csr.c | 202 if( ( ret = mbedtls_pk_parse_subpubkey( &p, end, &csr->pk ) ) != 0 ) in mbedtls_x509_csr_parse_der() 368 mbedtls_pk_get_name( &csr->pk ) ) ) != 0 ) in mbedtls_x509_csr_info() 374 (int) mbedtls_pk_get_bitlen( &csr->pk ) ); in mbedtls_x509_csr_info() 399 mbedtls_pk_free( &csr->pk ); in mbedtls_x509_csr_free()
|
D | x509_crt.c | 177 const mbedtls_pk_context *pk ) in x509_profile_check_key() argument 182 if( mbedtls_pk_get_bitlen( pk ) >= profile->rsa_min_bitlen ) in x509_profile_check_key() 194 mbedtls_ecp_group_id gid = mbedtls_pk_ec( *pk )->grp.id; in x509_profile_check_key() 821 if( ( ret = mbedtls_pk_parse_subpubkey( &p, end, &crt->pk ) ) != 0 ) in x509_crt_parse_der_core() 1418 mbedtls_pk_get_name( &crt->pk ) ) ) != 0 ) in mbedtls_x509_crt_info() 1424 (int) mbedtls_pk_get_bitlen( &crt->pk ) ); in mbedtls_x509_crt_info() 1683 if( x509_profile_check_key( profile, crl_list->sig_pk, &ca->pk ) != 0 ) in x509_crt_verifycrl() 1686 if( mbedtls_pk_verify_ext( crl_list->sig_pk, crl_list->sig_opts, &ca->pk, in x509_crt_verifycrl() 1971 if( mbedtls_pk_verify_ext( child->sig_pk, child->sig_opts, &trust_ca->pk, in x509_crt_verify_top() 1983 if( x509_profile_check_key( profile, child->sig_pk, &trust_ca->pk ) != 0 ) in x509_crt_verify_top() [all …]
|
D | debug.c | 280 const char *text, const mbedtls_pk_context *pk ) in debug_print_pk() argument 288 if( mbedtls_pk_debug( pk, items ) != 0 ) in debug_print_pk() 361 debug_print_pk( ssl, level, file, line, "crt->", &crt->pk ); in mbedtls_debug_print_crt()
|
D | pkcs11.c | 112 priv_key->len = mbedtls_pk_get_len( &cert.pk ); in mbedtls_pkcs11_priv_key_bind()
|
D | Makefile | 59 padlock.o pem.o pk.o \
|
D | CMakeLists.txt | 42 pk.c
|
/net-tools-3.7.0/mbedtls-2.4.0/include/mbedtls/ |
D | pk.h | 139 static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk ) in mbedtls_pk_rsa() argument 141 return( (mbedtls_rsa_context *) (pk).pk_ctx ); in mbedtls_pk_rsa() 152 static inline mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk ) in mbedtls_pk_ec() argument 154 return( (mbedtls_ecp_keypair *) (pk).pk_ctx ); in mbedtls_pk_ec() 586 mbedtls_pk_context *pk );
|
D | x509_csr.h | 60 mbedtls_pk_context pk; /**< Container for the public key context. */ member
|
D | x509_crt.h | 70 mbedtls_pk_context pk; /**< Container for the public key context. */ member
|
D | ssl_internal.h | 386 unsigned char mbedtls_ssl_sig_from_pk( mbedtls_pk_context *pk );
|
/net-tools-3.7.0/mbedtls-2.4.0/programs/x509/ |
D | cert_write.c | 458 subject_key = &csr.pk; in main() 500 if( !mbedtls_pk_can_do( &issuer_crt.pk, MBEDTLS_PK_RSA ) || in main() 501 mbedtls_mpi_cmp_mpi( &mbedtls_pk_rsa( issuer_crt.pk )->N, in main() 503 mbedtls_mpi_cmp_mpi( &mbedtls_pk_rsa( issuer_crt.pk )->E, in main()
|
/net-tools-3.7.0/mbedtls-2.4.0/yotta/data/example-benchmark/ |
D | main.cpp | 691 mbedtls_pk_context pk; in benchmark() local 698 mbedtls_pk_init( &pk ); in benchmark() 699 mbedtls_pk_parse_key( &pk, (const unsigned char *) rsa_keys[i], in benchmark() 701 rsa = mbedtls_pk_rsa( pk ); in benchmark() 703 mbedtls_snprintf( title, sizeof( title ), "RSA-%d", mbedtls_pk_get_bitlen( &pk ) ); in benchmark() 713 mbedtls_pk_free( &pk ); in benchmark()
|
/net-tools-3.7.0/mbedtls-2.4.0/tests/ |
D | CMakeLists.txt | 94 add_test_suite(pk)
|