CryptoSys PKI Pro Manual

Example: Rng.Bytes  Rng.Initialize  Rng.UpdateSeedFile 

[VB6 equivalent: RNG_Initialize]

Dim strSeedFile As String
Dim isOK As Boolean
Dim abData() As Byte
Dim nDataLen As Integer
Dim i As Integer

strSeedFile = "seed.dat"
' 1. Initialize
isOK = Rng.Initialize(strSeedFile)
Console.WriteLine("Rng.Initialize('" & strSeedFile & "') returns " & isOK & " (expecting True)")

' 2. Generate some random data
nDataLen = 24
For i = 1 To 3
    abData = Rng.Bytes(nDataLen)
    Console.WriteLine(Cnv.ToHex(abData))
Next

' 3. Update the seed file
isOK = Rng.UpdateSeedFile(strSeedFile)
Console.WriteLine("Rng.UpdateSeedFile('" & strSeedFile & "') returns " & isOK & " (expecting True)")

See Also:
Rng.Initialize Method

[Contents] [Index]

[PREV: Example: Rng.BytesWithPrompt ...]   [Contents]   [Index]   
   [NEXT: Example: Rng.Number ...]

Copyright © 2004-23 D.I. Management Services Pty Ltd. All rights reserved. Generated 2023-09-18T10:02:53Z.