RsaMakeKeys(String, String, String, Int32, RsaPublicExponent, RsaPbeOptions, String, RsaFormat, Boolean) Method |
Generate an RSA public/private key pair.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic 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
)
Public Shared Function MakeKeys (
publicKeyFile As String,
privateKeyFile As String,
password As String,
bits As Integer,
Optional exponent As RsaPublicExponent = RsaPublicExponent.Exp_EQ_65537,
Optional pbes As RsaPbeOptions = RsaPbeOptions.Default,
Optional paramString As String = "",
Optional fileFormat As RsaFormat = RsaFormat.Default,
Optional showProgress As Boolean = false
) As Integer
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
Int32Zero if successful or non-zero
error code
RemarksValid name-value pairs for paramString are:
count=integer | To set the iteration count used in the PBKDF2 method,
e.g. "count=5000;" [default=2048].
|
prf=hmac-name | To 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