CryptoSys PKI Pro Manual

CNV_B64Filter

Removes non-base64 characters from a string.

VBA/VB6 Syntax

Public Declare Function CNV_B64Filter Lib "diCrPKI.dll" (ByVal strOutput As String, ByVal strInput As String, ByVal nStrLen As Long) As Long

nRet = CNV_B64Filter(strOutput, strInput, nStrLen)

C/C++ Syntax

long __stdcall CNV_B64Filter(char *szOutput, const char *szInput, long nStrLen);

Parameters

szOutput
[out] to receive filtered characters.
szInput
[in] to be filtered.
nStrLen
[in] specifying the length of the input string.

Returns (VBA/C)

If successful, the return value is the number of characters in the filtered string; otherwise it returns a negative error code.

VBA Wrapper Syntax

Public Function cnvB64Filter (szB64 As String) As String

.NET Equivalent

Cnv.Base64Filter Method

Remarks

Specify a zero nOutChars or an empty string for szOutput to find the required length of the output string. ANSI C users must add one to this value when allocating memory.

Assumes that the output string is at least as long as the input string.

Example (VBA core function)

Wrapper function to return a filtered string directly:

Public Function cnvB64Filter(strB64 As String) As String
    Dim strFiltered As String
    Dim nDataLen As Long
    
    strFiltered = String(Len(strB64), " ")
    nDataLen = CNV_B64Filter(strFiltered, strB64, Len(strB64))
    strFiltered = Left$(strFiltered, nDataLen)
    cnvB64Filter = strFiltered
End Function

See Also

CNV_B64StrFromBytes CNV_BytesFromB64Str

[Contents] [Index]

[PREV: CMS_VerifySigData...]   [Contents]   [Index]   
   [NEXT: CNV_B64StrFromBytes...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.