Click or drag to resize

RsaSaveEncKey Method

Save an internal RSA key string to an encrypted key file.

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntax
public static int SaveEncKey(
	string outputFile,
	string privateKey,
	string password,
	RsaPbeOptions pbeOption,
	string paramString = "",
	RsaFormat format = RsaFormat.Default
)

Parameters

outputFile  String
Name of output file to be created
privateKey  String
The private RSA key as an internal key string.
password  String
Password to be used for the encrypted key file.
pbeOption  RsaPbeOptions
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).
format  RsaFormat  (Optional)
File format

Return Value

Int32
If successful, the return value is zero; otherwise it returns a nonzero 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