CryptoSys PKI Pro Manual

Rsa.SaveEncPrivateKey(String, String, Int32, String, CipherAlgorithm, HashAlgorithm, Rsa.Format) Method

Save a private key string to a PKCS-8 EncryptedPrivateKeyInfo file using PBES2 algorithm [DEPRECATED].

Syntax

[C#]
public static int SaveEncPrivateKey(
   string outputFile,
   string privateKey,
   int iterationCount,
   string password,
   CipherAlgorithm cipherAlg,
   HashAlgorithm hashAlg,
   Rsa.Format format 
)
[VB]
Public Shared Function SaveEncPrivateKey (
   outputFile As String,
   privateKey As String,
   iterationCount As Integer,
   password As String,
   cipherAlg As CipherAlgorithm,
   hashAlg As HashAlgorithm,
   format As Rsa.Format 
) As Integer

Parameters

outputFile  String
Name of file to create
privateKey  String
Private key in internal format
iterationCount  Int32
Iteration count to be used when encrypting file
password  String
Password string
cipherAlg  CipherAlgorithm
Block cipher to use for encryption scheme [default = des-ede3-cbc]
hashAlg  HashAlgorithm
Hash function to use in PRF HMAC algorithm [default = hmacWithSHA1]
format  Rsa.Format
File format

Return Value

Int32
If successful, the return value is zero; otherwise it returns a nonzero error code

See Also

VB6/C equivalent: RSA_SaveEncPrivateKey

[Contents] [Index]

[PREV: Rsa.SaveEncKey Method...]   [Contents]   [Index]   
   [NEXT: Rsa.SaveEncPrivateKey(String, String, Int32, String, Rsa.PbeOptions, Rsa.Format) Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.