tfSslAddEphemeralRsaKeys
Table of Contents >> SSL Programmer's Reference
| #include <trsocket.h> |
| int tfSslAddEphemeralRsaKeys | ( |
| int sessionId, | |
| ttUserVoidPtr fileNamePtr, | |
| int typeFormat | |
| ); |
Function Description
When an exportable cipher suite is used and if the serverâs certificate is RSA and its key length is more than 512 bits, we can not use that RSA key pair to exchange keys, instead, we have to use ephemeral RSA keys. To generate RSA key pair in running time will cost lots of CPU time, we donât support that, user must add ephemeral RSA keys by themselves using this function call. This function is valid only if both TM_USE_SSL_ SERVER and TM_PUBKEY_USE_RSA are defined. If you previously added one ephemeral RSA key, and later you want to update with a new ephemeral RSA key, you must call tfSslRemoveEphemeralRsaKeys() first. Note that the new 1024 exportable cipher suite allows up to 1024 bits for RSA keys.
Parameters
- sessionId
- The session Id to which to add ephemeral RSA keys
- fileNamePtr
- Pointer to a certificate file name with directory information or PEM/DER memory string of the certificate
- fileFormat
- Specify the type and format in fileNamePtr. The format is following OpenSSL format with following macros.
/* certificate with PEM (privacy enhanced mail) format */ TM_PKI_CERTIFICATE_PEM 0x01 /* certificate with DER encoding format */ TM_PKI_CERTIFICATE_DER 0x02 /* the above fileNamePtr is already a certificate string with PEM format, instead of a file name. In this case, fileNamePtr must be PEM format string*/ TM_PKI_CERTIFICATE_STRING 0x04
Returns
- TM_ENOERROR
- Callback function is successfully registered
- TM_EINVAL
- Invalid session Id or fileformat
- TM_ENOBUFS
- No more buffers