KeyGenParameterSpec.Builder.SetMgf1Digests(String[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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/KeyGenParameterSpec$Builder;", "", ApiSince=35)]
public Android.Security.Keystore.KeyGenParameterSpec.Builder SetMgf1Digests(params string[] mgf1Digests);
[<Android.Runtime.Register("setMgf1Digests", "([Ljava/lang/String;)Landroid/security/keystore/KeyGenParameterSpec$Builder;", "", ApiSince=35)>]
member this.SetMgf1Digests : string[] -> Android.Security.Keystore.KeyGenParameterSpec.Builder
Parameters
- mgf1Digests
- String[]
This value cannot 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 creation time if no digests have been explicitly provided. null may not be specified as a parameter to this method: It is not possible to disable MGF1 digest, a default must be present for when the caller tries to use it.
When using the key, the caller may not specify any digests that were not provided during key creation time. The caller may specify the default digest, SHA-1, if no digests were explicitly provided during key creation (but it is not necessary to do so).
See KeyProperties.DIGEST constants.
Android reference for android.security.keystore.KeyGenParameterSpec.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.