Generate an EC public/private key pair and save as two key files.
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 )
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
Valid name-value pairs for paramString are:
| Parameter | Description |
|---|---|
| count=integer | To set the iteration count used in the PBKDF2 method, e.g. "count=5000;" [default=2048]. |
| prf=hmac-name | To change the HMAC algorithm used in the PBKDF2 method, e.g. "prf=hmacwithSHA256;" [default=hmacwithSHA1]. |
| rngseed=string | To 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}.
// 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);
VB6/C equivalent: ECC_MakeKeys