CryptoSys PKI Pro Manual

Ecc.MakeKeys Method

Generate an EC public/private key pair and save as two key files.

Syntax

[C#]
public static int MakeKeys(
   string publicKeyfile,
   string privateKeyFile,
   Ecc.CurveName curveName,
   string password,
   Ecc.PbeScheme pbes = Ecc.PbeScheme.Default,
   string paramString = "",
   Ecc.Format fileFormat = Ecc.Format.Default 
)
[VB]
Public Shared Function MakeKeys (
   publicKeyfile As String,
   privateKeyFile As String,
   curveName As Ecc.CurveName,
   password As String,
   Optional pbes As Ecc.PbeScheme = Ecc.PbeScheme.Default,
   Optional paramString As String = "",
   Optional fileFormat As Ecc.Format = Ecc.Format.Default 
) As Integer

Parameters

publicKeyfile  String
name of public key file to be created
privateKeyFile  String
name of encrypted private key file to be created
curveName  Ecc.CurveName
name of elliptic curve
password  String
password to be used for the encrypted key file.
pbes  Ecc.PbeScheme  (Optional)
(optional) Password-based encryption scheme to encrypt private key [default = pbeWithSHAAnd3-KeyTripleDES-CBC]
paramString  String  (Optional)
Optional parameters. A set of attribute name=value pairs separated by a semicolon ";" (see remarks).
fileFormat  Ecc.Format  (Optional)
(optional) Format to save file [default = DER binary]

Return Value

Zero if successful or non-zero error code

Remarks

Valid name-value pairs for paramString are:

ParameterDescription
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].
rngseed=stringTo add some user-supplied entropy for the key generation process, e.g. "rngseed=pqrrr1234xyz;".

Valid values for hmac-name are one of {hmacWithSHA1, hmacWithSHA224, hmacWithSHA256, hmacWithSHA384, hmacWithSHA512}.

Example

// All default settings...
n = Ecc.MakeKeys(pubkeyfile, prikeyfile, Ecc.CurveName.Prime192v1, "password");
// With specialist options...
n = Ecc.MakeKeys(pubkeyfile, prikeyfile, Ecc.CurveName.Prime192v1, "password", 
       Ecc.PbeScheme.Pbe_Pbkdf2_aes128_CBC, "count=3999;prf=hmacWithSha256", Ecc.Format.PEM);

See Also

VB6/C equivalent: ECC_MakeKeys

[Contents] [Index]

[PREV: Ecc.KeyMatch Method...]   [Contents]   [Index]   
   [NEXT: Ecc.PublicKeyFromPrivate Method...]

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