Adapt gen_key example program to new RSA interface
diff --git a/library/rsa.c b/library/rsa.c
index 78db240..cc8f572 100644
--- a/library/rsa.c
+++ b/library/rsa.c
@@ -894,6 +894,9 @@
 
     ctx->len = ( mbedtls_mpi_bitlen( &ctx->N ) + 7 ) >> 3;
 
+    /* Double-check */
+    MBEDTLS_MPI_CHK( mbedtls_rsa_check_privkey( ctx ) );
+
 cleanup:
 
     mbedtls_mpi_free( &P1 ); mbedtls_mpi_free( &Q1 ); mbedtls_mpi_free( &H ); mbedtls_mpi_free( &G );