Android Guides | Samples

Javax.Crypto.Cipher.Wrap Method

Wraps a key using this cipher instance.

Syntax

[Android.Runtime.Register("wrap", "(Ljava/security/Key;)[B", "")]
public Byte[] Wrap (IKey key)

Parameters

key
the key to wrap.

Exceptions

TypeReason
IllegalBlockSizeExceptionif the size of the resulting bytes is not a multiple of the cipher block size.
InvalidKeyExceptionif this cipher instance can not wrap this key.
IllegalStateExceptionif this cipher instance is not initialized for wrapping.

Remarks

Wraps a key using this cipher instance.

[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