Android Guides | Samples

Javax.Crypto.Cipher.GetInstance Method

Creates a new Cipher for the specified transformation.

Syntax

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;)Ljavax/crypto/Cipher;", "")]
public static Cipher GetInstance (String transformation)

Parameters

transformation
the name of the transformation to create a cipher for.

Exceptions

TypeReason
NoSuchAlgorithmExceptionif no installed provider can provide the transformation, or it is null, empty or in an invalid format.
NoSuchPaddingExceptionif no installed provider can provide the padding scheme in the transformation.

Remarks

Creates a new Cipher for the specified transformation. The installed providers are searched in order for an implementation of the specified transformation. The first found provider providing the transformation is used to create the cipher. If no provider is found an exception is thrown.

[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