我想为系统中的每个用户(多个用户)生成私钥公钥对。我有以下代码来生成
RSA *rsa = RSA_new();
BIGNUM *bn = BN_new();
BN_set_word(bn, RSA_F4);
// We are assuming the PRNG is automatically seeded
// (should be the case if system has /dev/urandom)
RSA_generate_key_ex(rsa, NUM_BITS, bn, NULL);
BN_free(bn);
FILE *f = fopen("private.txt", "w");
PEM_write_RSAPrivateKey(f, rsa, NULL, NULL, 0, NULL, NULL);
f = freopen("public.txt", "w", f);
PEM_write_RSAPublicKey(f, rsa);
fclose(f);
RSA_free(rsa);
但这里为每个用户生成相同的密钥对,我没有为每个用户提供唯一标识符。我想知道是否可以为每个用户生成不同的密钥对?