Cipher.Unwrap(Byte[], String, KeyType) Method

Definition

Unwrap a previously wrapped key.

[Android.Runtime.Register("unwrap", "([BLjava/lang/String;I)Ljava/security/Key;", "")]
public Java.Security.IKey? Unwrap (byte[]? wrappedKey, string? wrappedKeyAlgorithm, Javax.Crypto.KeyType wrappedKeyType);
[<Android.Runtime.Register("unwrap", "([BLjava/lang/String;I)Ljava/security/Key;", "")>]
member this.Unwrap : byte[] * string * Javax.Crypto.KeyType -> Java.Security.IKey

Parameters

wrappedKey
Byte[]

the key to be unwrapped.

wrappedKeyAlgorithm
String

the algorithm associated with the wrapped key.

wrappedKeyType
KeyType

the type of the wrapped key. This must be one of SECRET_KEY, PRIVATE_KEY, or PUBLIC_KEY.

Returns

the unwrapped key.

Attributes

Exceptions

if the wrappedKey can not be unwrapped to a key of type wrappedKeyType for the wrappedKeyAlgorithm.

if no provider can be found that can create a key of type wrappedKeyType for the wrappedKeyAlgorithm.

if this cipher instance is not initialized for unwrapping.

Remarks

Unwrap a previously wrapped key.

Java documentation for javax.crypto.Cipher.unwrap(byte[], java.lang.String, 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