Android Guides | Samples

Javax.Crypto.Cipher.DoFinal Method

Finishes a multi-part transformation (encryption or decryption).

Syntax

[Android.Runtime.Register("doFinal", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I", "")]
public Int32 DoFinal (ByteBuffer input, ByteBuffer output)

Parameters

input
the input buffer.
output
the output buffer.

Exceptions

TypeReason
ShortBufferExceptionif the size of the output buffer is too small.
IllegalBlockSizeExceptionif the size of the resulting bytes is not a multiple of the cipher block size.
BadPaddingExceptionif the padding of the data does not match the padding scheme.
IllegalArgumentExceptionif the input buffer and the output buffer are the same object.
IllegalStateExceptionif this cipher instance is not initialized for encryption or decryption.

Remarks

Finishes a multi-part transformation (encryption or decryption).

Processes the input.remaining() bytes in input buffer at input.position(), and any bytes that have been buffered in previous update calls. The transformed bytes are placed into output buffer.

[Android Documentation]

Requirements

Namespace: Javax.Crypto
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1