CryptoSys PKI examples VB6 to VB.NET

RNG_Test

Carries out a health check and a FIPS-140-2 statistical test on the RNG.

VB6/VBA

Debug.Print "Testing RNG_Test ..."
Dim strFileName As String
Dim nRet As Long

strFileName = "pkiFips140.txt"
nRet = RNG_Test(strFileName, 0)
Debug.Print "RNG_Test('" & strFileName & "') returns " & nRet & " (expecting 0)"

Output

Testing RNG_Test ...
RNG_Test('pkiFips140.txt') returns 0 (expecting 0)

VB.NET

Console.WriteLine("Testing RNG_Test ...")
Dim strFileName As String
Dim isOK As Boolean

strFileName = "pkiFips140.txt"
isOK = Rng.Test(strFileName)
Console.WriteLine("Rng.Test('" & strFileName & "') returns " & isOK & " (expecting True)")

[Contents]

[HOME]   [NEXT: RSA_DecodeMsg...]

Copyright © 2010-20 D.I. Management Services Pty Ltd. All rights reserved.