CryptoAPITransform.TransformFinalBlock(Byte[], Int32, Int32) Method

Definition

Computes the transformation for the specified region of the specified byte array.

C#
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount);

Parameters

inputBuffer
Byte[]

The input on which to perform the operation on.

inputOffset
Int32

The offset into the byte array from which to begin using data from.

inputCount
Int32

The number of bytes in the byte array to use as data.

Returns

Byte[]

The computed transformation.

Implements

Exceptions

The inputBuffer parameter is null.

The inputOffset parameter is less than zero.

-or-

The inputCount parameter is less than zero.

-or-

The length of the input buffer is less than the sum of the input offset and the input count.

The PKCS7 padding is invalid.

The inputOffset parameter is out of range. This parameter requires a non-negative number.

Examples

The following code example demonstrates how to call the TransformFinalBlock method to transform the final block of bytes. This code example is part of a larger example provided for the CryptoAPITransform class.

C#
byte[] finalBytes = cryptoTransform.TransformFinalBlock(
    sourceBytes,
    currentPosition,
    sourceByteLength - currentPosition);

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also