KeyAgreement.GetInstance Method

Definition

Overloads

GetInstance(String, String)

Returns a KeyAgreement object that implements the specified key agreement algorithm.

GetInstance(String, Provider)

Returns a KeyAgreement object that implements the specified key agreement algorithm.

GetInstance(String)

Returns a KeyAgreement object that implements the specified key agreement algorithm.

GetInstance(String, String)

Returns a KeyAgreement object that implements the specified key agreement algorithm.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/lang/String;)Ljavax/crypto/KeyAgreement;", "")]
public static Javax.Crypto.KeyAgreement? GetInstance (string? algorithm, string? provider);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/lang/String;)Ljavax/crypto/KeyAgreement;", "")>]
static member GetInstance : string * string -> Javax.Crypto.KeyAgreement

Parameters

algorithm
String

the standard name of the requested key agreement algorithm. See the KeyAgreement section in the Java Security Standard Algorithm Names Specification for information about standard algorithm names.

provider
String

the name of the provider.

Returns

the new KeyAgreement object

Attributes

Exceptions

if the specified provider cannot provide the requested algorithm.

if the specified provider does not exist.

if the specified provider name is null or empty.

Remarks

Returns a KeyAgreement object that implements the specified key agreement algorithm.

A new KeyAgreement object encapsulating the KeyAgreementSpi implementation from the specified provider is returned. The specified provider must be registered in the security provider list.

Note that the list of registered providers may be retrieved via the Security#getProviders() Security.getProviders() method.

Java documentation for javax.crypto.KeyAgreement.getInstance(java.lang.String, java.lang.String).

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

GetInstance(String, Provider)

Returns a KeyAgreement object that implements the specified key agreement algorithm.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/security/Provider;)Ljavax/crypto/KeyAgreement;", "")]
public static Javax.Crypto.KeyAgreement? GetInstance (string? algorithm, Java.Security.Provider? provider);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;Ljava/security/Provider;)Ljavax/crypto/KeyAgreement;", "")>]
static member GetInstance : string * Java.Security.Provider -> Javax.Crypto.KeyAgreement

Parameters

algorithm
String

the standard name of the requested key agreement algorithm. See the KeyAgreement section in the Java Security Standard Algorithm Names Specification for information about standard algorithm names.

provider
Provider

the provider.

Returns

the new KeyAgreement object

Attributes

Exceptions

if the specified provider cannot provide the requested algorithm.

if the specified provider is null.

if the specified algorithm name is null.

Remarks

Returns a KeyAgreement object that implements the specified key agreement algorithm.

A new KeyAgreement object encapsulating the KeyAgreementSpi implementation from the specified Provider object is returned. Note that the specified Provider object does not have to be registered in the provider list.

Java documentation for javax.crypto.KeyAgreement.getInstance(java.lang.String, java.security.Provider).

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

GetInstance(String)

Returns a KeyAgreement object that implements the specified key agreement algorithm.

[Android.Runtime.Register("getInstance", "(Ljava/lang/String;)Ljavax/crypto/KeyAgreement;", "")]
public static Javax.Crypto.KeyAgreement? GetInstance (string? algorithm);
[<Android.Runtime.Register("getInstance", "(Ljava/lang/String;)Ljavax/crypto/KeyAgreement;", "")>]
static member GetInstance : string -> Javax.Crypto.KeyAgreement

Parameters

algorithm
String

the standard name of the requested key agreement algorithm. See the KeyAgreement section in the Java Security Standard Algorithm Names Specification for information about standard algorithm names.

Returns

the new KeyAgreement object

Attributes

Exceptions

if no installed provider can provide the requested algorithm.

if the specified algorithm is null.

Remarks

Returns a KeyAgreement object that implements the specified key agreement algorithm.

This method traverses the list of registered security Providers, starting with the most preferred Provider. A new KeyAgreement object encapsulating the KeyAgreementSpi implementation from the first Provider that supports the specified algorithm is returned.

Note that the list of registered providers may be retrieved via the Security#getProviders() Security.getProviders() method.

Java documentation for javax.crypto.KeyAgreement.getInstance(java.lang.String).

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