Language

KeyProtection.Builder.SetMgf1Digests(String[]) Method

Definition

Sets the set of hash functions (e.g., SHA-256, SHA-384) which could be used by the mask generation function MGF1 (which is used for certain operations with the key).

[Android.Runtime.Register("setMgf1Digests", "([Ljava/lang/String;)Landroid/security/keystore/KeyProtection$Builder;", "", ApiSince=35)]
public Android.Security.Keystore.KeyProtection.Builder SetMgf1Digests(params string[]? mgf1Digests);
[<Android.Runtime.Register("setMgf1Digests", "([Ljava/lang/String;)Landroid/security/keystore/KeyProtection$Builder;", "", ApiSince=35)>]
member this.SetMgf1Digests : string[] -> Android.Security.Keystore.KeyProtection.Builder

Parameters

mgf1Digests
String[]

This value may be null. Value is one of the following: KeyProperties.DIGEST_NONE; KeyProperties.DIGEST_MD5; KeyProperties.DIGEST_SHA1; KeyProperties.DIGEST_SHA224; KeyProperties.DIGEST_SHA256; KeyProperties.DIGEST_SHA384; KeyProperties.DIGEST_SHA512

Returns

Attributes

Remarks

Sets the set of hash functions (e.g., SHA-256, SHA-384) which could be used by the mask generation function MGF1 (which is used for certain operations with the key). Attempts to use the key with any other digest for the mask generation function will be rejected.

This can only be specified for signing/verification keys and RSA encryption/decryption keys used with RSA OAEP padding scheme because these operations involve a mask generation function (MGF1) with a digest. The default digest for MGF1 is SHA-1, which will be specified during key import time if no digests have been explicitly provided. When using the key, the caller may not specify any digests that were not provided during key import time. The caller may specify the default digest, SHA-1, if no digests were explicitly provided during key import (but it is not necessary to do so).

See KeyProperties.DIGEST constants.

Android reference for android.security.keystore.KeyProtection.Builder.setMgf1Digests.

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