RSA.
More...
Go to the source code of this file.
|
| struct crypto_rsa_key * | crypto_rsa_import_public_key (const u8 *buf, size_t len) |
| | Import an RSA public key. More...
|
| |
|
struct crypto_rsa_key * | crypto_rsa_import_public_key_parts (const u8 *n, size_t n_len, const u8 *e, size_t e_len) |
| |
| struct crypto_rsa_key * | crypto_rsa_import_private_key (const u8 *buf, size_t len) |
| | Import an RSA private key. More...
|
| |
| size_t | crypto_rsa_get_modulus_len (struct crypto_rsa_key *key) |
| | Get the modulus length of the RSA key. More...
|
| |
| int | crypto_rsa_exptmod (const u8 *in, size_t inlen, u8 *out, size_t *outlen, struct crypto_rsa_key *key, int use_private) |
| | RSA modular exponentiation. More...
|
| |
| void | crypto_rsa_free (struct crypto_rsa_key *key) |
| | Free RSA key. More...
|
| |
| int crypto_rsa_exptmod |
( |
const u8 * |
in, |
|
|
size_t |
inlen, |
|
|
u8 * |
out, |
|
|
size_t * |
outlen, |
|
|
struct crypto_rsa_key * |
key, |
|
|
int |
use_private |
|
) |
| |
RSA modular exponentiation.
- Parameters
-
| in | Input data |
| inlen | Input data length |
| out | Buffer for output data |
| outlen | Maximum size of the output buffer and used size on success |
| key | RSA key |
| use_private | 1 = Use RSA private key, 0 = Use RSA public key |
- Returns
- 0 on success, -1 on failure
Free RSA key.
- Parameters
-
This function frees an RSA key imported with either crypto_rsa_import_public_key() or crypto_rsa_import_private_key().
Get the modulus length of the RSA key.
- Parameters
-
- Returns
- Modulus length of the key
| struct crypto_rsa_key* crypto_rsa_import_private_key |
( |
const u8 * |
buf, |
|
|
size_t |
len |
|
) |
| |
Import an RSA private key.
- Parameters
-
| buf | Key buffer (DER encoded RSA private key) |
| len | Key buffer length in bytes |
- Returns
- Pointer to the private key or NULL on failure
| struct crypto_rsa_key* crypto_rsa_import_public_key |
( |
const u8 * |
buf, |
|
|
size_t |
len |
|
) |
| |
Import an RSA public key.
- Parameters
-
| buf | Key buffer (DER encoded RSA public key) |
| len | Key buffer length in bytes |
- Returns
- Pointer to the public key or NULL on failure