Mac.GetInstance Method

Definition

Overloads

GetInstance(String)

Returns a <code>Mac</code> object that implements the specified MAC algorithm.

GetInstance(String, Provider)

Returns a <code>Mac</code> object that implements the specified MAC algorithm.

GetInstance(String, String)

Returns a <code>Mac</code> object that implements the specified MAC algorithm.

GetInstance(String)

Returns a <code>Mac</code> object that implements the specified MAC algorithm.

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

Parameters

algorithm
String

the standard name of the requested MAC algorithm. See the Mac section in the <a href= "https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#Mac"> Java Cryptography Architecture Standard Algorithm Name Documentation</a> for information about standard algorithm names.

Returns

Mac

the new <code>Mac</code> object.

Attributes

Exceptions

if the specified algorithm is not available by any provider.

if algorithm is null (instead of NoSuchAlgorithmException as in 1.4 release).

Remarks

Java documentation for javax.crypto.Mac.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

GetInstance(String, Provider)

Returns a <code>Mac</code> object that implements the specified MAC algorithm.

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

Parameters

algorithm
String

the standard name of the requested MAC algorithm. See the Mac section in the <a href= "https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#Mac"> Java Cryptography Architecture Standard Algorithm Name Documentation</a> for information about standard algorithm names.

provider
Provider

the provider.

Returns

Mac

the new <code>Mac</code> object.

Attributes

Exceptions

if the specified algorithm is not provided by the specified provider.

if provider is null.

if algorithm is null (instead of NoSuchAlgorithmException as in 1.4 release).

Remarks

Java documentation for javax.crypto.Mac.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, String)

Returns a <code>Mac</code> object that implements the specified MAC algorithm.

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

Parameters

algorithm
String

the standard name of the requested MAC algorithm. See the Mac section in the <a href= "https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#Mac"> Java Cryptography Architecture Standard Algorithm Name Documentation</a> for information about standard algorithm names.

provider
String

the name of the provider.

Returns

Mac

the new <code>Mac</code> object.

Attributes

Exceptions

if the specified algorithm is not provided by the specified provider.

if the specified provider is not available.

if the specified provider name is null or empty.

if algorithm is null (instead of NoSuchAlgorithmException as in 1.4 release).

Remarks

Java documentation for javax.crypto.Mac.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