共用方式為


Mac.DoFinal Method

Definition

Overloads

DoFinal()

Finishes the MAC operation.

DoFinal(Byte[])

Processes the given array of bytes and finishes the MAC operation.

DoFinal(Byte[], Int32)

Finishes the MAC operation.

DoFinal()

Finishes the MAC operation.

[Android.Runtime.Register("doFinal", "()[B", "")]
public byte[]? DoFinal ();
[<Android.Runtime.Register("doFinal", "()[B", "")>]
member this.DoFinal : unit -> byte[]

Returns

Byte[]

the MAC result.

Attributes

Exceptions

if this MAC is not initialized.

Remarks

Finishes the MAC operation.

A call to this method resets this Mac object to the state it was in when previously initialized via a call to init(Key) or init(Key, AlgorithmParameterSpec). That is, the object is reset and available to generate another MAC from the same key, if desired, via new calls to update and doFinal. (In order to reuse this Mac object with a different key, it must be reinitialized via a call to init(Key) or init(Key, AlgorithmParameterSpec).

Java documentation for javax.crypto.Mac.doFinal().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

DoFinal(Byte[])

Processes the given array of bytes and finishes the MAC operation.

[Android.Runtime.Register("doFinal", "([B)[B", "")]
public byte[]? DoFinal (byte[]? input);
[<Android.Runtime.Register("doFinal", "([B)[B", "")>]
member this.DoFinal : byte[] -> byte[]

Parameters

input
Byte[]

data in bytes

Returns

Byte[]

the MAC result.

Attributes

Exceptions

if this MAC is not initialized.

Remarks

Processes the given array of bytes and finishes the MAC operation.

A call to this method resets this Mac object to the state it was in when previously initialized via a call to init(Key) or init(Key, AlgorithmParameterSpec). That is, the object is reset and available to generate another MAC from the same key, if desired, via new calls to update and doFinal. (In order to reuse this Mac object with a different key, it must be reinitialized via a call to init(Key) or init(Key, AlgorithmParameterSpec).

Java documentation for javax.crypto.Mac.doFinal(byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

DoFinal(Byte[], Int32)

Finishes the MAC operation.

[Android.Runtime.Register("doFinal", "([BI)V", "")]
public void DoFinal (byte[]? output, int outOffset);
[<Android.Runtime.Register("doFinal", "([BI)V", "")>]
member this.DoFinal : byte[] * int -> unit

Parameters

output
Byte[]

the buffer where the MAC result is stored

outOffset
Int32

the offset in output where the MAC is stored

Attributes

Exceptions

if the specified output buffer is either too small for the digest to be stored, the specified output buffer is null, or the specified offset is negative or past the length of the output buffer.

if this MAC is not initialized.

Remarks

Finishes the MAC operation.

A call to this method resets this Mac object to the state it was in when previously initialized via a call to init(Key) or init(Key, AlgorithmParameterSpec). That is, the object is reset and available to generate another MAC from the same key, if desired, via new calls to update and doFinal. (In order to reuse this Mac object with a different key, it must be reinitialized via a call to init(Key) or init(Key, AlgorithmParameterSpec).

The MAC result is stored in output, starting at outOffset inclusive.

Java documentation for javax.crypto.Mac.doFinal(byte[], int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to