Click or drag to resize

RsaMakeKeys(String, String, String, Int32, RsaPublicExponent, RsaPbeOptions, String, RsaFormat, Boolean) Method

Generate an RSA public/private key pair.

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntax
public static int MakeKeys(
	string publicKeyFile,
	string privateKeyFile,
	string password,
	int bits,
	RsaPublicExponent exponent = RsaPublicExponent.Exp_EQ_65537,
	RsaPbeOptions pbes = RsaPbeOptions.Default,
	string paramString = "",
	RsaFormat fileFormat = RsaFormat.Default,
	bool showProgress = false
)

Parameters

publicKeyFile  String
Output filename for public key
privateKeyFile  String
Output filename for (encrypted) private key
password  String
Password for encrypted private key
bits  Int32
Required key modulus size in bits (min 96)
exponent  RsaPublicExponent  (Optional)
Exponent [default=65537=F4]
pbes  RsaPbeOptions  (Optional)
Encryption scheme to encrypt private key [default=pbeWithSHAAnd3-KeyTripleDES-CBC from PKCS#12]
paramString  String  (Optional)
Optional parameters. A set of attribute name=value pairs separated by a semicolon ";" (see remarks)
fileFormat  RsaFormat  (Optional)
Format to save file [default = DER binary]
showProgress  Boolean  (Optional)
Indicate progress in console

Return Value

Int32
Zero if successful or non-zero error code
Remarks

Valid name-value pairs for paramString are:

count=integerTo set the iteration count used in the PBKDF2 method, e.g. "count=5000;" [default=2048].
prf=hmac-nameTo change the HMAC algorithm used in the PBKDF2 method, e.g. "prf=hmacwithSHA256;" [default=hmacwithSHA1].
Valid values for hmac-name are {hmacWithSHA1|hmacWithSHA224|hmacWithSHA256|hmacWithSHA384|hmacWithSHA512}.
See Also