CryptoSys PKI Pro Manual

Ecc.ReadPrivateKey Method

Read from a file or string containing an EC private key into an "internal" private key string.

Syntax

[C#]
public static StringBuilder ReadPrivateKey(
   string keyFileOrString,
   string password = "" 
)
[VB]
Public Shared Function ReadPrivateKey (
   keyFileOrString As String,
   Optional password As String = "" 
) As StringBuilder

Parameters

keyFileOrString  String
Name of private key file or a PEM String containing the key
password  String  (Optional)
Password for private key, if encrypted; or "" if not

Return Value

StringBuilder containing an internal representation of the private key; or an empty StringBuilder if error

Remarks

This returns a StringBuilder, not a string, to allow secure wiping. Use sb.ToString() to obtain a string. Use Wipe.String(sb) to clear.

See Also

VB6/C equivalent: ECC_ReadPrivateKey

[Contents] [Index]

[PREV: Ecc.ReadKeyByCurve Method...]   [Contents]   [Index]   
   [NEXT: Ecc.ReadPublicKey Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-17T11:18:15Z.