CryptoSys API Library Manual

AES192_InitError

AES192_InitError returns the error code after an unsuccessful call to AES192_Init or AES192_InitHex.

VB6/VBA Syntax

Public Declare Function AES192_InitError Lib "diCryptoSys.dll" () As Long

nRet = AES192_InitError()

Parameters

None

C/C++ Syntax

long _stdcall AES192_InitError(void);

Returns (VB6/C)

Long: Returns the error code from the last call to AES192_Init or AES192_InitHex.

.NET Equivalent

Aes192.ErrCode Property

Remarks

Example

    Dim hContext As Long
    Dim nRet As Long
    
    ' Try to initialise with an invalid key
    hContext = AES192_InitHex("THIS IS NOT HEX!", ENCRYPT, _
        "CBC", "0123456789abcdef0123456789abcdef")
    If hContext = 0 Then
        nRet = AES192_InitError()
        Debug.Print "AES192_InitHex failed (" & apiErrorLookup(nRet) & ")"
    End If
    
    ' Try with an invalid mode
    hContext = AES192_InitHex("000102030405060708090a0b0c0d0e0f1011121314151617", _
        ENCRYPT, "XXX", "0123456789abcdef0123456789abcdef")
    If hContext = 0 Then
        nRet = AES192_InitError()
        Debug.Print "AES192_InitHex failed (" & apiErrorLookup(nRet) & ")"
    End If

This should produce the output

AES192_InitHex failed (Invalid key)
AES192_InitHex failed (Invalid mode)

See Also

API_ErrorLookup

[Contents] [Index]

[HOME]   [NEXT: AES192_InitHex...]

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