SealedObject.GetObject Method

Definition

Overloads

GetObject(IKey)

Retrieves the original (encapsulated) object.

GetObject(Cipher)

Retrieves the original (encapsulated) object.

GetObject(IKey, String)

Retrieves the original (encapsulated) object.

GetObject(IKey)

Retrieves the original (encapsulated) object.

[Android.Runtime.Register("getObject", "(Ljava/security/Key;)Ljava/lang/Object;", "")]
public Java.Lang.Object? GetObject (Java.Security.IKey? key);
[<Android.Runtime.Register("getObject", "(Ljava/security/Key;)Ljava/lang/Object;", "")>]
override this.GetObject : Java.Security.IKey -> Java.Lang.Object

Parameters

key
IKey

the key used to unseal the object.

Returns

the original object.

Attributes

Exceptions

if deserialization fails.

if deserialization fails.

if the algorithm to decrypt the data is not available.

if the specified key cannot be used to decrypt the data.

Remarks

Retrieves the original (encapsulated) object.

This method creates a cipher for the algorithm that had been used in the sealing operation. If the default provider package provides an implementation of that algorithm, an instance of Cipher containing that implementation is used. If the algorithm is not available in the default package, other packages are searched. The Cipher object is initialized for decryption, using the given key and the parameters (if any) that had been used in the sealing operation.

The encapsulated object is unsealed and de-serialized, before it is returned.

Java documentation for javax.crypto.SealedObject.getObject(java.security.Key).

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

GetObject(Cipher)

Retrieves the original (encapsulated) object.

[Android.Runtime.Register("getObject", "(Ljavax/crypto/Cipher;)Ljava/lang/Object;", "")]
public Java.Lang.Object? GetObject (Javax.Crypto.Cipher? c);
[<Android.Runtime.Register("getObject", "(Ljavax/crypto/Cipher;)Ljava/lang/Object;", "")>]
override this.GetObject : Javax.Crypto.Cipher -> Java.Lang.Object

Parameters

c
Cipher

the cipher used to unseal the object

Returns

the original object.

Attributes

Exceptions

if deserialization fails.

if deserialization fails.

if the specified cipher is a block cipher and the length of the serialized data is not a multiple of the ciphers block size.

if the padding of the data does not match the padding scheme.

Remarks

Retrieves the original (encapsulated) object.

The encapsulated object is unsealed (using the given Cipher, assuming that the Cipher is already properly initialized) and de-serialized, before it is returned.

Java documentation for javax.crypto.SealedObject.getObject(javax.crypto.Cipher).

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

GetObject(IKey, String)

Retrieves the original (encapsulated) object.

[Android.Runtime.Register("getObject", "(Ljava/security/Key;Ljava/lang/String;)Ljava/lang/Object;", "")]
public Java.Lang.Object? GetObject (Java.Security.IKey? key, string? provider);
[<Android.Runtime.Register("getObject", "(Ljava/security/Key;Ljava/lang/String;)Ljava/lang/Object;", "")>]
override this.GetObject : Java.Security.IKey * string -> Java.Lang.Object

Parameters

key
IKey

the key used to unseal the object.

provider
String

the name of the provider of the algorithm to unseal the object.

Returns

the original object.

Attributes

Exceptions

if deserialization fails.

if deserialization fails.

if the algorithm used to decrypt the data is not available.

if the specified provider is not available.

if the specified key cannot be used to decrypt the data.

Remarks

Retrieves the original (encapsulated) object.

This method creates a cipher for the algorithm that had been used in the sealing operation, using an implementation of that algorithm from the given provider. The Cipher object is initialized for decryption, using the given key and the parameters (if any) that had been used in the sealing operation.

The encapsulated object is unsealed and de-serialized, before it is returned.

Java documentation for javax.crypto.SealedObject.getObject(java.security.Key, java.lang.String).

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