How can I extract the exponent "e" and the private key "d" after the cryptGenerateKey function? (cryptlib library)
cryptCreateContext( &cryptContext, CRYPT_UNUSED, CRYPT_ALGO_RSA );
cryptSetAttributeString( cryptContext, CRYPT_CTXINFO_LABEL, KEY_ID, strlen(KEY_ID));
cryptSetAttribute( cryptContext, CRYPT_CTXINFO_KEYSIZE, 4096 / 8 );
cryptGenerateKey(cryptContext);
Thank you for your help
cheers
Daniel
Quoting the cryptlib manual:
Private keys can’t be exported as such, but can only be stored in keysets or crypto devices
You shouldn't normally ever need to export the value of a private key; I'm guessing that cryptlib's lack of a function to do so is deliberate. In other words, if you somehow thought that exporting d
was a good idea, you'd probably have to modify cryptlib to allow it.