Removes the padding from an encryption block.
Public Declare Function PAD_UnpadBytes Lib "diCrPKI.dll" (ByRef abOutput As Byte, ByVal nOutputLen As Long, ByRef abInput As Byte, ByVal nInputLen As Long, ByVal nBlockLen As Long, ByVal nOptions As Long) As Long
nRet = PAD_UnpadBytes(abOutput(0), nOutputLen, abInput(0), nInputLen, nBlockLen, 0)
Byte array to be filled with the output.Long specifying the size of the output array in bytes.Byte array containing the padded data.Long specifying the length of the input in bytes.Long specifying the cipher block length in bytes (8 or 16).Long option flags: not used in this release. Specify zero.
long _stdcall PAD_UnpadBytes(unsigned char *output, long outlen, const unsigned char *input, long inlen, long blklen, long options);
Long: If successful, the return value is the number of bytes in the output;
otherwise it returns a negative error code.
Use the method associated with the relevant encryption algorithm class:
Cipher.Unpad Method (Byte[], CipherAlgorithm)
The padding is expected according to the convention in
PKCS#5, PKCS#7 and CMS.
If abOutput is set to vbNull or nOutputLen set to zero,
then the required number of bytes will be returned. The output is always shorter than the input.
Only block lengths of 8 or 16 bytes are supported.
VB6 users should note the '(0)' in abOutput(0) and abInput(0).
See the example in PAD_BytesBlock.
PAD_BytesBlock
PAD_HexBlock
PAD_UnpadHex