Click or drag to resize

EccSaveEncKey Method

Save an internal EC private key string to an encrypted private 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 internalKey,
	string password,
	EccPbeScheme pbes,
	string paramString,
	EccFormat fileFormat
)

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

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