Save an internal EC private key string to an encrypted private key file.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic static int SaveEncKey(
string outputFile,
string internalKey,
string password,
EccPbeScheme pbes,
string paramString,
EccFormat fileFormat
)
Public Shared Function SaveEncKey (
outputFile As String,
internalKey As String,
password As String,
pbes As EccPbeScheme,
paramString As String,
fileFormat As EccFormat
) As Integer
Parameters
- outputFile String
- name of key file to be created
- internalKey String
- the private key in an internal key string
- password String
- the password to be used for the encrypted key file
- pbes EccPbeScheme
- Password-based encryption scheme to encrypt private key
[default = pbeWithSHAAnd3-KeyTripleDES-CBC]
- paramString String
- Optional parameters.
A set of attribute name=value pairs separated by a semicolon ";" (see remarks).
Set as "" for defaults.
- fileFormat EccFormat
- Format to save file [default = DER binary]
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