Android Guides | Samples

Javax.Crypto.CipherSpi Class

This class defines the Service Provider Interface (SPI) for cryptographic ciphers.

See Also: CipherSpi

Syntax

[Android.Runtime.Register("javax/crypto/CipherSpi", DoNotGenerateAcw=true)]
public abstract class CipherSpi : Object

Remarks

This class defines the Service Provider Interface (SPI) for cryptographic ciphers.

Implementers of cryptographic ciphers must implement all the abstract methods for every cipher they implement. CipherSpi instances are created along with ciphers when the Cipher.GetInstance(String) method is called. A Cipher is referenced by a transformation, which is a string that describes the operation (or set of operations), always consisting of the cipher's name and optionally followed by a mode and a padding, in the form:

  • "algorithm"
  • "algorithm/mode/padding"
The following behavior should be implemented for obtaining Cipher instances.

When one of the Cipher.GetInstance(String) factory methods is called with a transformation that is only an algorithm, check if the provider defines a CipherSpi for "algorithm", if so: return it, otherwise throw a NoSuchAlgorithmException.

The following rules apply when a transformation is of the form "algorithm/mode/padding":

          See Also

          [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

          The members of Javax.Crypto.CipherSpi are listed below.

          See Also: Object

          Public Constructors

          Creates a new CipherSpi instance.

          Protected Constructors

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

          Protected Properties

          [read-only]
          override
          ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
          [read-only]
          override
          ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

          Protected Methods

          EngineDoFinal(ByteBuffer, ByteBuffer) : Int32
          Finishes a multi-part transformation (encryption or decryption).
          abstract
          EngineDoFinal(Byte[], Int32, Int32) : Byte[]
          Finishes a multi-part transformation (encryption or decryption).
          abstract
          EngineDoFinal(Byte[], Int32, Int32, Byte[], Int32) : Int32
          Finishes a multi-part transformation (encryption or decryption).
          abstract
          EngineGetBlockSize() : Int32
          Returns the block size of this cipher (in bytes)
          abstract
          EngineGetIV() : Byte[]
          Returns the Initialization Vector (IV) that was used to initialize this cipher or null if none was used.
          EngineGetKeySize(IKey) : Int32
          Returns the size of a specified key object in bits.
          abstract
          EngineGetOutputSize(Int32) : Int32
          Returns the size for a buffer (in bytes), that the next call to update of doFinal would return, taking into account any buffered data from previous update calls and padding.
          abstract
          EngineGetParameters() : AlgorithmParameters
          Returns the parameters that where used to create this cipher instance.
          abstract
          EngineInit(Int32, IKey, SecureRandom)
          Initializes this cipher instance with the specified key and a source of randomness.
          abstract
          EngineInit(Int32, IKey, AlgorithmParameters, SecureRandom)
          Initializes this cipher instance with the specified key, algorithm parameters and a source of randomness.
          abstract
          EngineInit(Int32, IKey, IAlgorithmParameterSpec, SecureRandom)
          Initializes this cipher instance with the specified key, algorithm parameters and a source of randomness.
          abstract
          EngineSetMode(String)
          Sets the mode for this cipher.
          abstract
          EngineSetPadding(String)
          Sets the padding method for this cipher.
          EngineUnwrap(Byte[], String, Int32) : IKey
          Unwraps a key using this cipher instance.
          EngineUpdate(ByteBuffer, ByteBuffer) : Int32
          Continues a multi-part transformation (encryption or decryption).
          abstract
          EngineUpdate(Byte[], Int32, Int32) : Byte[]
          Continues a multi-part transformation (encryption or decryption).
          abstract
          EngineUpdate(Byte[], Int32, Int32, Byte[], Int32) : Int32
          Continues a multi-part transformation (encryption or decryption).
          EngineUpdateAAD(ByteBuffer)
          Continues a multi-part transformation (encryption or decryption).
          EngineUpdateAAD(Byte[], Int32, Int32)
          Continues a multi-part transformation (encryption or decryption) with Authenticated Additional Data (AAD).
          EngineWrap(IKey) : Byte[]
          Wraps a key using this cipher instance.