mbedtls_rsa_import() is only used within mbedTLS.
 
Symbols
loading...
Files
loading...

mbedtls_rsa_import() function

This function imports a set of core parameters into an RSA context. Any sequence of calls to this function should be followed by a call to mbedtls_rsa_complete(), which checks and completes the provided information to a ready-for-use public or private RSA key.

Syntax

int mbedtls_rsa_import( mbedtls_rsa_context *ctx,     const mbedtls_mpi *N,     const mbedtls_mpi *P,     const mbedtls_mpi *Q,     const mbedtls_mpi *D,     const mbedtls_mpi *E );

Arguments

ctx

The initialized RSA context to store the parameters in.

N

The RSA modulus. This may be \c NULL.

P

The first prime factor of \p N. This may be \c NULL.

Q

The second prime factor of \p N. This may be \c NULL.

D

The private exponent. This may be \c NULL.

E

The public exponent. This may be \c NULL.

Return value

\c 0 on success. A non-zero error code on failure.

Notes

This function can be called multiple times for successive imports, if the parameters are not simultaneously present. See mbedtls_rsa_complete() for more information on which parameters are necessary to set up a private or public RSA key. The imported parameters are copied and need not be preserved for the lifetime of the RSA context being set up.

References

LocationText
rsa.h:201
int mbedtls_rsa_import( mbedtls_rsa_context *ctx,