CryptoSys PKI Toolkit Manual

WIPE_Data

Zeroises data in memory.

VB6/VBA Syntax

Public Declare Function WIPE_Data Lib "diCrPKI.dll" (ByRef abData As Byte, ByVal nBytes As Long) As Long

Alternative aliases for Visual Basic users to deal with Byte and String types explicitly:
Public Declare Function WIPE_Bytes Lib "diCrPKI.dll" Alias "WIPE_Data" (ByRef abData As Byte, ByVal nBytes As Long) As Long
Public Declare Function WIPE_String Lib "diCrPKI.dll" Alias "WIPE_Data" (ByVal strData As String, ByVal nStrLen As Long) As Long

nRet = WIPE_Data(abData(0), nBytes)

Visual Basic only:-
nRet = WIPE_Bytes(abData(0), nBytes)
nRet = WIPE_String(strData, nStrLen)

Parameters

abData
[in/out] Byte array to be cleared.
nBytes
[in] Long specifying the number of bytes to be cleared.

C/C++ Syntax

long _stdcall WIPE_Data(void *lpData, long datalen);

Returns (VB6/C)

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

.NET Equivalent

Wipe.Data Method

Remarks

This function does not free any memory; it just zeroises it.

VB6/VBA users: Note the '(0)' in abData(0).

Examples

nRet = WIPE_Data(abData(0), n)
nRet = WIPE_Bytes(abData(0), n)
Dim strData As String
strData = "my deepest secrets"
nRet = WIPE_String(strData, Len(strData))
strData = ""
long pwdlen;
char password[256];

pwdlen = PWD_Prompt(password, sizeof(password)-1, "Test");
if (pwdlen >= 0)
	printf("Password entered=[%s]\n", password);
else
	printf("No password entered\n");
/* ... do something with password ... */
WIPE_Data(password, pwdlen);

See Also

[Contents] [Index]

[HOME]   [NEXT: WIPE_File...]

Copyright © 2004-12 D.I. Management Services Pty Ltd. All rights reserved.