Edit

Share via


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

Definition

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

public:
 virtual cli::array <System::Byte> ^ TransformFinalBlock(cli::array <System::Byte> ^ inputBuffer, int inputOffset, int inputCount);
public byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount);
abstract member TransformFinalBlock : byte[] * int * int -> byte[]
override this.TransformFinalBlock : byte[] * int * int -> byte[]
Public Function TransformFinalBlock (inputBuffer As Byte(), inputOffset As Integer, inputCount As Integer) As Byte()

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.

array<Byte>^finalBytes = cryptoTransform->TransformFinalBlock(
   sourceBytes, currentPosition, sourceByteLength - currentPosition );
byte[] finalBytes = cryptoTransform.TransformFinalBlock(
    sourceBytes,
    currentPosition,
    sourceByteLength - currentPosition);
Dim finalBytes() As Byte
finalBytes = cryptoTransform.TransformFinalBlock( _
    sourceBytes, _
    currentPosition, _
    sourceByteLength - currentPosition)

Applies to

See also