CryptoSys PKI Pro Manual

Rsa.SaveEncKey Method

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

Syntax

[C#]
public static int SaveEncKey(
	string outputFile,
	string privateKey,
	string password,
	Rsa.PbeOptions pbeOption,
	string paramString,
	Rsa.Format format
)
[VB.NET]
Public Shared Function SaveEncKey ( _
	outputFile As String, _
	privateKey As String, _
	password As String, _
	pbeOption As Rsa.PbeOptions, _
	paramString As String, _
	format As Rsa.Format _
) As Integer

Parameters

outputFile
Name of output file to be created
privateKey
The private RSA key as an internal key string.
password
Password to be used for the encrypted key file.
pbeOption
Type: Rsa.PbeOptions
Encryption scheme to encrypt private key [default = pbeWithSHAAnd3-KeyTripleDES-CBC from PKCS#12]
paramString
Optional parameters. A set of attribute name=value pairs separated by a semicolon ";" (see remarks).
format
Type: Rsa.Format
File format

Return Value

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

VB6/C equivalent: RSA_SaveEncKey

[Contents] [Index]

[PREV: Rsa.ReadPublicKey Method...]   [Contents]   [Index]   
   [NEXT: Rsa.SaveEncPrivateKey Method (String, String, Int32, String, CipherAlgorithm, HashAlgorithm, Rsa.Format)...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.