ica_rsa_key_generate_crt

Purpose

Generates RSA keys in Chinese-Remainder Theorem (CRT) format.

Comments

This function allows users to generate RSA keys for any granularity in the range 57 - 4096 bits. For specific information about some of these parameters, see the considerations in Data structures.

Format


unsigned int ica_rsa_key_generate_crt(ica_adapter_handle_t adapter_handle,
  unsigned int modulus_bit_length,
  ica_rsa_key_mod_expo_t *public_key,
  ica_rsa_key_crt_t *private_key);

Parameters

ica_adapter_handle_t adapter_handle
Pointer to a previously opened device handle.
unsigned int modulus_bit_length
Length in bits of the modulus part of the key. This value should comply with the length of the keys (in bytes), according to this calculation:
key_length = (modulus_bits + 7) / 8
ica_rsa_key_mod_expo_t *public_key
Pointer to where the generated public key is to be placed. If the exponent element in the public key is not set, it is randomly generated. A poorly chosen exponent can result in the program looping endlessly. Common public exponents are 3 and 65537.
ica_rsa_key_crt_t *private_key
Pointer to where the generated private key in CRT format is to be placed. Length of both private and public keys should be set in bytes. This value should comply with the length of the keys (in bytes), according to this calculation
key_length = (modulus_bits + 7) / 8

Return codes

0
Success
EPERM

Used RSA key is > 4K.

For return codes indicating exceptions, see Return codes.