Save an internal RSA key string to an encrypted key file.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic static int SaveEncKey(
string outputFile,
string privateKey,
string password,
RsaPbeOptions pbeOption,
string paramString = "",
RsaFormat format = RsaFormat.Default
)
Public Shared Function SaveEncKey (
outputFile As String,
privateKey As String,
password As String,
pbeOption As RsaPbeOptions,
Optional paramString As String = "",
Optional format As RsaFormat = RsaFormat.Default
) As Integer
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
Int32If successful, the return value is zero; otherwise it returns a nonzero
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