RSAGenerateKeyPair()

The function RSAGenerateKeyPair() generates a public and a private key for the functions RSASealEnvelope() and RSAOpenEnvelope().

Synopsis

int RSAGenerateKeyPair(string &publicPEM, string &privatePEM[, int bits = 2048]);

Parameters

Parameter Description
publicPEM The public key is used to encrypt the data by using the function RSASealEnvelope()
privatePEM The private key is used to decrypt the data.
bits Key size: number of bits used in the public (publicPEM) and private (privatePEM) keys.

Return value

In case of an error, the function returns -1 and otherwise 0.

Description

The function RSAGenerateKeyPair() generates a public and a private key for the functions RSASealEnvelope() and RSAOpenEnvelope().

Assignment

RSA Functions

Availability

UI