This commit adds key parsing routine in client example. Because
sometimes server requires client's signature for authentication.
Change-Id: Iddcf87417bac0e4eba092df845ee20b00597fad5
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
mbedtls_printf(" ok (%d skipped)\n", ret);
/*
- * 1.2. Load own certificate
+ * 1.2. Load own certificate and key
*/
mbedtls_printf(" . Loading the own cert...");
fflush(stdout);
mbedtls_printf(" ok\n");
+ mbedtls_printf(" . Loading the Private Key...");
+ fflush(stdout);
+
+ if ((ret = mbedtls_pk_parse_key(&pkey, (const unsigned char *) mbedtls_test_cli_key_rsa, mbedtls_test_cli_key_rsa_len, NULL, 0)) != 0)
+ {
+ mbedtls_printf(" failed\n ! mbedtls_pk_parse_key returned %d\n\n", ret);
+ goto exit;
+ }
+
/*
* 2. Start the connection
*/