CryptoSys PKI Pro Manual


Creates a new seed file suitable for use with RNG_Initialize().

VBA/VB6 Syntax

Public Declare Function RNG_MakeSeedFile Lib "diCrPKI.dll" (ByVal strSeedFile As String, ByVal strPrompt As String, ByVal nOptions As Long) As Long

nRet = RNG_MakeSeedFile(strSeedFile, strPrompt, nOptions)

C/C++ Syntax

long __stdcall RNG_MakeSeedFile(const char *szSeedFile, const char *szPrompt, long nOptions);


[in] specifying the seed file to be created.
[in] specifying an (optional) prompt for the dialog. Specify an empty string ("") or NULL to use the default dialog.
[in] option flags:
PKI_DEFAULT (0) for default options
PKI_RNG_STRENGTH_112 to make user generate an estimated 112 bits of security (default)
PKI_RNG_STRENGTH_128 to make user generate an estimated 128 bits of security
PKI_RNG_STRENGTH_192 to make user generate an estimated 192 bits of security
PKI_RNG_STRENGTH_256 to make user generate an estimated 256 bits of security

Returns (VBA/C)

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

.NET Equivalent

Rng.MakeSeedFile Method

Python Equivalent

static Rng.make_seedfile(seedfilename, strength=Strength.BITS_128, prompt='')


This uses a dialog window and expects the user to type in random keystrokes. Such a GUI interface may not be appropriate in all circumstances. A new seed file is always created. Any existing file with the same name will be overwritten without warning. Alternatively, use the command-line program, PkiMkRngSeed.exe, provided in the distribution to make a new seed file [updated in v22.1].


Dim strSeedFile As String
Dim nRet As Long

strSeedFile = "seed.dat"
nRet = RNG_MakeSeedFile(strSeedFile, "Making a new seed file: hit random keys until done...", PKI_RNG_STRENGTH_128)
Debug.Print "RNG_MakeSeedFile('" & strSeedFile & "') returns " & nRet & " (expecting 0)"

See Also

RNG_Initialize RNG_UpdateSeedFile

[Contents] [Index]

[PREV: RNG_Initialize...]   [Contents]   [Index]   
   [NEXT: RNG_Number...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-01T11:51:59Z.