CryptoSys API Library Manual

RNG_MakeSeedFile

RNG_MakeSeedFile creates a new seed file suitable for use with RNG_Initialize.

VB6/VBA Syntax

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

nRet = RNG_MakeSeedFile(strSeedFile, strPrompt, nOptions)

Parameters

strSeedFile
[in] String specifying the seed file to be created.
strPrompt
[in] String specifying an (optional) prompt for the dialog. Specify an empty string ("") or NULL to use the default dialog.
nOptions
[in] Long option flags:
API_DEFAULT (0) for default options
API_RNG_STRENGTH_112 to make user generate an estimated 112 bits of security (default)
API_RNG_STRENGTH_128 to make user generate an estimated 128 bits of security

C/C++ Syntax

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

Returns (VB6/C)

Long: If successful, the return value is zero; otherwise it returns a non-zero error code.

.NET Equivalent

Rng.MakeSeedFile Method (String)
Rng.MakeSeedFile Method (String, String, Rng.Strength)

Remarks

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.

Example

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...", API_RNG_STRENGTH_128)
Debug.Print "RNG_MakeSeedFile('" & strSeedFile & "') returns " & nRet & " (expecting 0)"

See Also

RNG_Initialize RNG_UpdateSeedFile

[Contents] [Index]

[HOME]   [NEXT: RNG_NonceData...]

Copyright © 2001-9 D.I. Management Services Pty Ltd. All rights reserved.