Android Guides | Samples

Javax.Crypto.Cipher.Unwrap Method

Unwraps a key using this cipher instance.

Syntax

[Android.Runtime.Register("unwrap", "([BLjava/lang/String;I)Ljava/security/Key;", "")]
public IKey Unwrap (Byte[] wrappedKey, String wrappedKeyAlgorithm, [Android.Runtime.GeneratedEnum] KeyType wrappedKeyType)

Parameters

wrappedKey
the wrapped key to unwrap.
wrappedKeyAlgorithm
the algorithm for the wrapped key.
wrappedKeyType
the type of the wrapped key (one of: SECRET_KEY , PRIVATE_KEY or PUBLIC_KEY)

Exceptions

TypeReason
InvalidKeyExceptionif the wrappedKey can not be unwrapped to a key of type wrappedKeyType for the wrappedKeyAlgorithm.
NoSuchAlgorithmExceptionif no provider can be found that can create a key of type wrappedKeyType for the wrappedKeyAlgorithm.
IllegalStateExceptionif this cipher instance is not initialized for unwrapping.

Remarks

Unwraps 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