Cipher Class

Definition

This class provides access to implementations of cryptographic ciphers for encryption and decryption.

[Android.Runtime.Register("javax/crypto/Cipher", ApiSince=1, DoNotGenerateAcw=true)]
public class Cipher : Java.Lang.Object
type Cipher = class
    inherit Object
Inheritance
Cipher
Derived
Attributes

Remarks

Android platform documentation

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.

Constructors

Cipher(CipherSpi, Provider, String)

Creates a new Cipher instance.

Cipher(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

DecryptMode
Obsolete.

Constant for decryption operation mode.

EncryptMode
Obsolete.

Constant for encryption operation mode.

PrivateKey
Obsolete.

Constant indicating that the key to be unwrapped is a private key.

PublicKey
Obsolete.

Constant indicating that the key to be unwrapped is a public key.

SecretKey
Obsolete.

Constant indicating that the key to be unwrapped is a secret key.

UnwrapMode
Obsolete.

Constant for key unwrapping operation mode.

WrapMode
Obsolete.

Constant for key wrapping operation mode.

Properties

Algorithm

Returns the name of the algorithm of this cipher instance.

BlockSize

Returns this ciphers block size (in bytes).

Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
ExemptionMechanism

Returns the exemption mechanism associated with this cipher.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Parameters

Returns the parameters that where used to create this cipher instance.

PeerReference (Inherited from Object)
Provider

Returns the provider of this cipher instance.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
DoFinal()

Finishes a multi-part transformation (encryption or decryption).

DoFinal(Byte[])

Finishes a multi-part transformation (encryption or decryption).

DoFinal(Byte[], Int32)

Finishes a multi-part transformation (encryption or decryption).

DoFinal(Byte[], Int32, Int32)

Finishes a multi-part transformation (encryption or decryption).

DoFinal(Byte[], Int32, Int32, Byte[])

Finishes a multi-part transformation (encryption or decryption).

DoFinal(Byte[], Int32, Int32, Byte[], Int32)

Finishes a multi-part transformation (encryption or decryption).

DoFinal(ByteBuffer, ByteBuffer)

Finishes a multi-part transformation (encryption or decryption).

Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetInstance(String)

Creates a new Cipher for the specified transformation.

GetInstance(String, Provider)

Creates a new cipher for the specified transformation.

GetInstance(String, String)

Creates a new cipher for the specified transformation provided by the specified provider.

GetIV()

initialization vector

GetMaxAllowedKeyLength(String)

Returns the maximum key length for the specified transformation.

GetMaxAllowedParameterSpec(String)

Returns the maximum cipher parameter value for the specified transformation.

GetOutputSize(Int32)

Returns the length in bytes an output buffer needs to be when this cipher is updated with inputLen bytes.

Init(CipherMode, Certificate)

Initializes this cipher instance with the public key from the specified certificate.

Init(CipherMode, Certificate, SecureRandom)

Initializes this cipher instance with the public key from the specified certificate and a source of randomness.

Init(CipherMode, IKey)

Initializes this cipher instance with the specified key.

Init(CipherMode, IKey, AlgorithmParameters)

Initializes this cipher instance with the specified key and algorithm parameters.

Init(CipherMode, IKey, AlgorithmParameters, SecureRandom)

Initializes this cipher instance with the specified key, algorithm parameters and a source of randomness.

Init(CipherMode, IKey, IAlgorithmParameterSpec)

Initializes this cipher instance with the specified key and algorithm parameters.

Init(CipherMode, IKey, IAlgorithmParameterSpec, SecureRandom)

Initializes this cipher instance with the specified key, algorithm parameters and a source of randomness.

Init(CipherMode, IKey, SecureRandom)

Initializes this cipher instance with the specified key and a source of randomness.

JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Unwrap(Byte[], String, KeyType)

Unwraps a key using this cipher instance.

Update(Byte[])

Continues a multi-part transformation (encryption or decryption).

Update(Byte[], Int32, Int32)

Continues a multi-part transformation (encryption or decryption).

Update(Byte[], Int32, Int32, Byte[])

Continues a multi-part transformation (encryption or decryption).

Update(Byte[], Int32, Int32, Byte[], Int32)

Continues a multi-part transformation (encryption or decryption).

Update(ByteBuffer, ByteBuffer)

Continues a multi-part transformation (encryption or decryption).

UpdateAAD(Byte[])

Continues a multi-part transformation (encryption or decryption) with Authenticated Additional Data (AAD).

UpdateAAD(Byte[], Int32, Int32)

Continues a multi-part transformation (encryption or decryption) with Authenticated Additional Data (AAD).

UpdateAAD(ByteBuffer)

Continues a multi-part transformation (encryption or decryption) with Authenticated Additional Data (AAD).

Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wrap(IKey)

Wraps a key using this cipher instance.

Explicit Interface Implementations

IJavaObjectEx.IsProxy (Inherited from Object)
IJavaObjectEx.KeyHandle (Inherited from Object)
IJavaObjectEx.NeedsActivation (Inherited from Object)
IJavaObjectEx.ToLocalJniHandle() (Inherited from Object)
IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to