Cipher Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This class provides the functionality of a cryptographic cipher for encryption and decryption.
[Android.Runtime.Register("javax/crypto/Cipher", DoNotGenerateAcw=true)]
public class Cipher : Java.Lang.Object
[<Android.Runtime.Register("javax/crypto/Cipher", DoNotGenerateAcw=true)>]
type Cipher = class
inherit Object
- Inheritance
- Derived
- Attributes
Remarks
Java documentation for 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.
Constructors
| Cipher(CipherSpi, Provider, String) |
Creates a Cipher object. |
| Cipher(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Fields
| DecryptMode |
Obsolete.
Constant used to initialize cipher to decryption mode. |
| EncryptMode |
Obsolete.
Constant used to initialize cipher to encryption mode. |
| PrivateKey |
Obsolete.
Constant used to indicate the to-be-unwrapped key is a "private key". |
| PublicKey |
Obsolete.
Constant used to indicate the to-be-unwrapped key is a "public key". |
| SecretKey |
Obsolete.
Constant used to indicate the to-be-unwrapped key is a "secret key". |
| UnwrapMode |
Obsolete.
Constant used to initialize cipher to key-unwrapping mode. |
| WrapMode |
Obsolete.
Constant used to initialize cipher to key-wrapping mode. |
Properties
| Algorithm |
Returns the algorithm name of this <code>Cipher</code> object. |
| BlockSize |
Returns the block size (in bytes). |
| Class |
Returns the runtime class of this |
| ExemptionMechanism |
Returns the exemption mechanism object used with this cipher. |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| JniIdentityHashCode | (Inherited from Object) |
| JniPeerMembers | |
| Parameters |
Returns the parameters used with this cipher. |
| PeerReference | (Inherited from Object) |
| Provider |
Returns the provider of this <code>Cipher</code> object. |
| 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 multiple-part encryption or decryption operation, depending on how this cipher was initialized. |
| DoFinal(Byte[]) |
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| DoFinal(Byte[], Int32) |
Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized. |
| DoFinal(Byte[], Int32, Int32) |
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| DoFinal(Byte[], Int32, Int32, Byte[]) |
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| DoFinal(Byte[], Int32, Int32, Byte[], Int32) |
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| DoFinal(ByteBuffer, ByteBuffer) |
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| GetInstance(String) |
Returns a <code>Cipher</code> object that implements the specified transformation. |
| GetInstance(String, Provider) |
Returns a <code>Cipher</code> object that implements the specified transformation. |
| GetInstance(String, String) |
Returns a <code>Cipher</code> object that implements the specified transformation. |
| GetIV() |
Returns the initialization vector (IV) in a new buffer. |
| GetMaxAllowedKeyLength(String) |
Returns the maximum key length for the specified transformation according to the installed JCE jurisdiction policy files. |
| GetMaxAllowedParameterSpec(String) |
Returns an AlgorithmParameterSpec object which contains the maximum cipher parameter value according to the jurisdiction policy file. |
| GetOutputSize(Int32) |
Returns the length in bytes that an output buffer would need to be in order to hold the result of the next <code>update</code> or <code>doFinal</code> operation, given the input length <code>inputLen</code> (in 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() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| ToArray<T>() | (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| UnregisterFromRuntime() | (Inherited from Object) |
| Unwrap(Byte[], String, KeyType) |
Unwrap a previously wrapped key. |
| Update(Byte[]) |
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| Update(Byte[], Int32, Int32) |
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| Update(Byte[], Int32, Int32, Byte[]) |
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| Update(Byte[], Int32, Int32, Byte[], Int32) |
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| Update(ByteBuffer, ByteBuffer) |
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| UpdateAAD(Byte[]) |
Continues a multi-part update of the Additional Authentication Data (AAD). |
| UpdateAAD(Byte[], Int32, Int32) |
Continues a multi-part update of the Additional Authentication Data (AAD), using a subset of the provided buffer. |
| UpdateAAD(ByteBuffer) |
Continues a multi-part update of the Additional Authentication Data (AAD). |
| Wait() |
Causes the current thread to wait until another thread invokes the
|
| Wait(Int64) |
Causes the current thread to wait until either another thread invokes the
|
| Wait(Int64, Int32) |
Causes the current thread to wait until another thread invokes the
|
| Wrap(IKey) |
Wrap a key. |
Explicit Interface Implementations
| 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) | |