tfPkiOwnKeyPairAdd
Table of Contents >> Optional Protocols >> Cryptography
| #include <trsecapi.h> |
| int tfPkiOwnKeyPairAdd | ( |
| ttUserVoidPtr fileNamePtr, | |
| int typeFormat, | |
| int keyType | |
| ); |
Function Description
This function adds a public-private key pair of local (owner) certificate.
Parameters
- fileNamePtr
- Pointer to a certificate file name with directory information or PEM string of the certificate.
- typeFormat
- The type and format of the 'fileNamePtr' parameter (see below).
- keyType
- One of the following:
- TM_PKI_RSA_KEY (0)
- TM_PKI_DSA_KEY (1)
- TM_PKI_ECDSA_KEY (2)
Possible 'typeFormat' Values
| Name | Value | Description |
|---|---|---|
| TM_PKI_CERTIFICATE_PEM | (ttUser8Bit)0x01 | Certificate with PEM (Privacy Enhanced Mail) format. |
| TM_PKI_CERTIFICATE_DER | (ttUser8Bit)0x02 | Certificate with DER encoding format. |
| TM_PKI_CERTIFICATE_STRING | (ttUser8Bit)0x04 | The 'fileNamePtr' variable points to a string instead of a file. If this flag is used then the string should only contain the characters between the -----BEGIN... and -----END... tags. |
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- One of the parameters is invalid.
- TM_ENOBUFS
- Insufficient memory to complete the operation.