Cipher.Init Cipher.Init Method

Definition

Overloads

Init(CipherMode, IKey, IAlgorithmParameterSpec, SecureRandom) Init(CipherMode, IKey, IAlgorithmParameterSpec, SecureRandom)

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

Init(CipherMode, IKey, AlgorithmParameters, SecureRandom) Init(CipherMode, IKey, AlgorithmParameters, SecureRandom)

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

Init(CipherMode, IKey, IAlgorithmParameterSpec) Init(CipherMode, IKey, IAlgorithmParameterSpec)

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

Init(CipherMode, IKey, SecureRandom) Init(CipherMode, IKey, SecureRandom)

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

Init(CipherMode, IKey, AlgorithmParameters) Init(CipherMode, IKey, AlgorithmParameters)

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

Init(CipherMode, Certificate, SecureRandom) Init(CipherMode, Certificate, SecureRandom)

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

Init(CipherMode, IKey) Init(CipherMode, IKey)

Initializes this cipher instance with the specified key.

Init(CipherMode, Certificate) Init(CipherMode, Certificate)

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

Init(CipherMode, IKey, IAlgorithmParameterSpec, SecureRandom) Init(CipherMode, IKey, IAlgorithmParameterSpec, SecureRandom)

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

[Android.Runtime.Register("init", "(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;Ljava/security/SecureRandom;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.IKey key, Java.Security.Spec.IAlgorithmParameterSpec params, Java.Security.SecureRandom random);
member this.Init : Javax.Crypto.CipherMode * Java.Security.IKey * Java.Security.Spec.IAlgorithmParameterSpec * Java.Security.SecureRandom -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

key
IKey IKey

the input key for the operation.

params
IAlgorithmParameterSpec IAlgorithmParameterSpec

the algorithm parameters.

random
SecureRandom SecureRandom

the source of randomness to use.

Exceptions

if the specified key can not be used to initialize this cipher instance.

it the specified parameters are inappropriate for this cipher.

if the specified opmode is invalid.

Remarks

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.

Init(CipherMode, IKey, AlgorithmParameters, SecureRandom) Init(CipherMode, IKey, AlgorithmParameters, SecureRandom)

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

[Android.Runtime.Register("init", "(ILjava/security/Key;Ljava/security/AlgorithmParameters;Ljava/security/SecureRandom;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.IKey key, Java.Security.AlgorithmParameters params, Java.Security.SecureRandom random);
member this.Init : Javax.Crypto.CipherMode * Java.Security.IKey * Java.Security.AlgorithmParameters * Java.Security.SecureRandom -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

key
IKey IKey

the input key for the operation.

params
AlgorithmParameters AlgorithmParameters

the algorithm parameters.

random
SecureRandom SecureRandom

the source of randomness to use.

Exceptions

if the specified key can not be used to initialize this cipher instance.

if the specified parameters are inappropriate for this cipher.

if the specified opmode is invalid.

Remarks

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.

Init(CipherMode, IKey, IAlgorithmParameterSpec) Init(CipherMode, IKey, IAlgorithmParameterSpec)

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

[Android.Runtime.Register("init", "(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.IKey key, Java.Security.Spec.IAlgorithmParameterSpec params);
member this.Init : Javax.Crypto.CipherMode * Java.Security.IKey * Java.Security.Spec.IAlgorithmParameterSpec -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

key
IKey IKey

the input key for the operation.

params
IAlgorithmParameterSpec IAlgorithmParameterSpec

the algorithm parameters.

Exceptions

if the specified key can not be used to initialize this cipher instance.

it the specified parameters are inappropriate for this cipher.

Remarks

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.

Init(CipherMode, IKey, SecureRandom) Init(CipherMode, IKey, SecureRandom)

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

[Android.Runtime.Register("init", "(ILjava/security/Key;Ljava/security/SecureRandom;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.IKey key, Java.Security.SecureRandom random);
member this.Init : Javax.Crypto.CipherMode * Java.Security.IKey * Java.Security.SecureRandom -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

key
IKey IKey

the input key for the operation.

random
SecureRandom SecureRandom

the source of randomness to use.

Exceptions

if the specified key can not be used to initialize this cipher instance.

if the specified opmode is invalid.

Remarks

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.

Init(CipherMode, IKey, AlgorithmParameters) Init(CipherMode, IKey, AlgorithmParameters)

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

[Android.Runtime.Register("init", "(ILjava/security/Key;Ljava/security/AlgorithmParameters;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.IKey key, Java.Security.AlgorithmParameters params);
member this.Init : Javax.Crypto.CipherMode * Java.Security.IKey * Java.Security.AlgorithmParameters -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

key
IKey IKey

the input key for the operation.

params
AlgorithmParameters AlgorithmParameters

the algorithm parameters.

Exceptions

if the specified key can not be used to initialize this cipher instance.

it the specified parameters are inappropriate for this cipher.

Remarks

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.

Init(CipherMode, Certificate, SecureRandom) Init(CipherMode, Certificate, SecureRandom)

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

[Android.Runtime.Register("init", "(ILjava/security/cert/Certificate;Ljava/security/SecureRandom;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.Cert.Certificate certificate, Java.Security.SecureRandom random);
member this.Init : Javax.Crypto.CipherMode * Java.Security.Cert.Certificate * Java.Security.SecureRandom -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

certificate
Certificate Certificate

the certificate.

random
SecureRandom SecureRandom

the source of randomness to be used.

Exceptions

if the public key in the certificate can not be used to initialize this cipher instance.

Remarks

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.

Init(CipherMode, IKey) Init(CipherMode, IKey)

Initializes this cipher instance with the specified key.

[Android.Runtime.Register("init", "(ILjava/security/Key;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.IKey key);
member this.Init : Javax.Crypto.CipherMode * Java.Security.IKey -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

key
IKey IKey

the input key for the operation.

Exceptions

if the specified key can not be used to initialize this cipher instance.

Remarks

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.

Init(CipherMode, Certificate) Init(CipherMode, Certificate)

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

[Android.Runtime.Register("init", "(ILjava/security/cert/Certificate;)V", "")]
public void Init (Javax.Crypto.CipherMode opmode, Java.Security.Cert.Certificate certificate);
member this.Init : Javax.Crypto.CipherMode * Java.Security.Cert.Certificate -> unit

Parameters

opmode
CipherMode CipherMode

the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).

certificate
Certificate Certificate

the certificate.

Exceptions

if the public key in the certificate can not be used to initialize this cipher instance.

Remarks

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