Compartilhar via


KeyAgreement.Init Method

Definition

Overloads

Init(IKey)

Initializes this key agreement with the given key, which is required to contain all the algorithm parameters required for this key agreement.

Init(IKey, SecureRandom)

Initializes this key agreement with the given key and source of randomness.

Init(IKey, IAlgorithmParameterSpec)

Initializes this key agreement with the given key and set of algorithm parameters.

Init(IKey, IAlgorithmParameterSpec, SecureRandom)

Initializes this key agreement with the given key, set of algorithm parameters, and source of randomness.

Init(IKey)

Initializes this key agreement with the given key, which is required to contain all the algorithm parameters required for this key agreement.

[Android.Runtime.Register("init", "(Ljava/security/Key;)V", "")]
public void Init (Java.Security.IKey? key);
[<Android.Runtime.Register("init", "(Ljava/security/Key;)V", "")>]
member this.Init : Java.Security.IKey -> unit

Parameters

key
IKey

the party's private information. For example, in the case of the Diffie-Hellman key agreement, this would be the party's own Diffie-Hellman private key.

Attributes

Exceptions

if the specified key cannot be used to initialize this key agreement.

Remarks

Initializes this key agreement with the given key, which is required to contain all the algorithm parameters required for this key agreement.

If this key agreement requires any random bytes, it will get them using the java.security.SecureRandom implementation of the highest-priority installed provider as the source of randomness. (If none of the installed providers supply an implementation of SecureRandom, a system-provided source of randomness will be used.)

Java documentation for javax.crypto.KeyAgreement.init(java.security.Key).

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

Init(IKey, SecureRandom)

Initializes this key agreement with the given key and source of randomness.

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

Parameters

key
IKey

the party's private information. For example, in the case of the Diffie-Hellman key agreement, this would be the party's own Diffie-Hellman private key.

random
SecureRandom

the source of randomness

Attributes

Exceptions

if the specified key cannot be used to initialize this key agreement.

Remarks

Initializes this key agreement with the given key and source of randomness. The given key is required to contain all the algorithm parameters required for this key agreement.

If the key agreement algorithm requires random bytes, it gets them from the given source of randomness, random. However, if the underlying algorithm implementation does not require any random bytes, random is ignored.

Java documentation for javax.crypto.KeyAgreement.init(java.security.Key, java.security.SecureRandom).

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

Init(IKey, IAlgorithmParameterSpec)

Initializes this key agreement with the given key and set of algorithm parameters.

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

Parameters

key
IKey

the party's private information. For example, in the case of the Diffie-Hellman key agreement, this would be the party's own Diffie-Hellman private key.

params
IAlgorithmParameterSpec

the key agreement parameters

Attributes

Exceptions

if the specified key cannot be used to initialize this key agreement.

if the specified parameters are invalid for this key agreement algorithm.

Remarks

Initializes this key agreement with the given key and set of algorithm parameters.

If this key agreement requires any random bytes, it will get them using the java.security.SecureRandom implementation of the highest-priority installed provider as the source of randomness. (If none of the installed providers supply an implementation of SecureRandom, a system-provided source of randomness will be used.)

Java documentation for javax.crypto.KeyAgreement.init(java.security.Key, java.security.spec.AlgorithmParameterSpec).

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

Init(IKey, IAlgorithmParameterSpec, SecureRandom)

Initializes this key agreement with the given key, set of algorithm parameters, and source of randomness.

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

Parameters

key
IKey

the party's private information. For example, in the case of the Diffie-Hellman key agreement, this would be the party's own Diffie-Hellman private key.

params
IAlgorithmParameterSpec

the key agreement parameters

random
SecureRandom

the source of randomness

Attributes

Exceptions

if the specified key cannot be used to initialize this key agreement.

if the specified parameters are invalid for this key agreement algorithm.

Remarks

Initializes this key agreement with the given key, set of algorithm parameters, and source of randomness.

Java documentation for javax.crypto.KeyAgreement.init(java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom).

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